{
  "schemaVersion": 1,
  "slug": "upload-time-calculator",
  "category": "productivity",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "9b8d712ccc54dbe67e72782243c963a9bf1c0a8f9f0e7804476021e6534b0e3f",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/upload-time-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "v=V×η÷100; t=8×F×10⁹×n÷(v×10⁶); MB/s=v÷8; m=H_d−t÷3600",
    "vars": [
      [
        "F",
        "File size (GiB)"
      ],
      [
        "n",
        "Number of files"
      ],
      [
        "V",
        "Upload speed (Mbps)"
      ],
      [
        "η",
        "Efficiency (%)"
      ],
      [
        "t",
        "Upload time (s)"
      ],
      [
        "m",
        "Deadline margin (h)"
      ]
    ],
    "note": "F is decimal GB per file (10⁹ bytes); n assumes equal-sized files; Mbps is decimal megabits/s; MB/s is decimal megabytes/s; efficiency is user-selected."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const effectiveSpeed=uploadSpeed*(efficiency/100);const bytes=fileSize*1000000000*files;const seconds=bytes*8/(effectiveSpeed*1000000);const hours=seconds/3600;return {effectiveSpeed,seconds,hours,speedMBps:effectiveSpeed/8,fits:hours<=deadlineHours?'Yes — it will finish in time':'No — start now or use a faster connection',margin:deadlineHours-hours};",
    "inputs": [
      {
        "name": "fileSize",
        "type": "number",
        "default": 10,
        "min": 0.001,
        "max": 100000,
        "step": 0.1
      },
      {
        "name": "uploadSpeed",
        "type": "number",
        "default": 20,
        "min": 0.1,
        "max": 100000,
        "step": 0.1
      },
      {
        "name": "files",
        "type": "number",
        "default": 1,
        "min": 1,
        "max": 10000,
        "step": 1
      },
      {
        "name": "efficiency",
        "type": "number",
        "default": 85,
        "min": 10,
        "max": 100,
        "step": 1,
        "slider": true
      },
      {
        "name": "deadlineHours",
        "type": "number",
        "default": 4,
        "min": 0.1,
        "max": 720,
        "step": 0.5,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "seconds",
        "precision": 1,
        "unit": "s"
      },
      {
        "name": "fits",
        "precision": 0,
        "unit": "",
        "type": "text"
      },
      {
        "name": "effectiveSpeed",
        "precision": 2,
        "unit": "Mbps"
      },
      {
        "name": "hours",
        "precision": 2,
        "unit": "h"
      },
      {
        "name": "speedMBps",
        "precision": 2,
        "unit": "MB/s"
      },
      {
        "name": "margin",
        "precision": 2,
        "unit": "h"
      }
    ],
    "interpret": null
  }
}
