{
  "address": "36b6fdfdd7ba1d235f432f1a4ac6b64c",
  "category": "other",
  "question": "How many GiB are in 1 GB?",
  "answer": "0.931323 GiB",
  "askedBy": {
    "kind": "guest",
    "display": "method deck",
    "stamped": false,
    "id": null
  },
  "answeredBy": "method",
  "madeAt": "2026-09-30T22:39:30.722Z",
  "validUntil": null,
  "validityClass": "forever",
  "sources": [
    {
      "label": "IEC 80000-13:2008",
      "url": null
    }
  ],
  "supersedes": null,
  "supersededBy": null,
  "isSeed": false,
  "seedSource": null,
  "seedAttribution": null,
  "duplicateOfQid": null,
  "publishedAt": null,
  "unpublishedAt": null,
  "voteCount": 0,
  "queuedForSubstrate": false,
  "answerMethod": "method",
  "unsourced": false,
  "source": {
    "kind": "standard",
    "value": "IEC 80000-13:2008, Quantities and units - Part 13: Information science and technology",
    "retrieved_utc": "2026-09-30T19:29:48Z"
  },
  "qsha256": "a40c6f5032d822a4cc1acc1e0a3725c6fab229e80348e713b188ee8cc007ddbc",
  "runOne": null,
  "cardContractVersion": "card_contract/1",
  "deck_id": "method-deck",
  "deck_title": "Method Deck",
  "method": {
    "name": "Data size conversion",
    "version": "1",
    "source_url_or_file": "methods/data-size-conversion.cjs",
    "sha256_of_method_file": "f00d821d4c3bc9c0d26eef3afe8cab52644ee39c61773ddfffbaee1c52e81530"
  },
  "receipt": {
    "inSubstrate": false,
    "local": true,
    "modelCallsAtMint": 0,
    "tokensAtMint": 0
  },
  "method_deck": {
    "inputs": [
      {
        "name": "value",
        "type": "number",
        "unit": "from_unit",
        "required": true,
        "description": "The data size to convert",
        "min": 0
      },
      {
        "name": "from_unit",
        "type": "string",
        "required": true,
        "description": "Unit of the input value",
        "enum": [
          "bit",
          "byte",
          "KB",
          "MB",
          "GB",
          "TB",
          "KiB",
          "MiB",
          "GiB",
          "TiB"
        ]
      },
      {
        "name": "to_unit",
        "type": "string",
        "required": true,
        "description": "Unit to convert into",
        "enum": [
          "bit",
          "byte",
          "KB",
          "MB",
          "GB",
          "TB",
          "KiB",
          "MiB",
          "GiB",
          "TiB"
        ]
      }
    ],
    "outputs": [
      {
        "name": "result",
        "unit": "to_unit",
        "description": "The converted data size"
      }
    ],
    "steps": [
      "Look up the exact bit-equivalent of from_unit and of to_unit: byte=8 bits; KB/MB/GB/TB are 8*1000^n bits (decimal); KiB/MiB/GiB/TiB are 8*1024^n bits (binary).",
      "Convert the input to bits: bits = value * bits_per(from_unit).",
      "Convert bits to the target unit: result = bits / bits_per(to_unit).",
      "Round result to 6 significant figures."
    ],
    "constants": [
      {
        "name": "bit",
        "value": 1,
        "unit": "bit",
        "source": 0
      },
      {
        "name": "byte",
        "value": 8,
        "unit": "bit",
        "source": 0
      },
      {
        "name": "KB",
        "value": 8000,
        "unit": "bit",
        "source": 0
      },
      {
        "name": "MB",
        "value": 8000000,
        "unit": "bit",
        "source": 0
      },
      {
        "name": "GB",
        "value": 8000000000,
        "unit": "bit",
        "source": 0
      },
      {
        "name": "TB",
        "value": 8000000000000,
        "unit": "bit",
        "source": 0
      },
      {
        "name": "KiB",
        "value": 8192,
        "unit": "bit",
        "source": 0
      },
      {
        "name": "MiB",
        "value": 8388608,
        "unit": "bit",
        "source": 0
      },
      {
        "name": "GiB",
        "value": 8589934592,
        "unit": "bit",
        "source": 0
      },
      {
        "name": "TiB",
        "value": 8796093022208,
        "unit": "bit",
        "source": 0
      }
    ],
    "examples": [
      {
        "name": "worked example",
        "inputs": {
          "value": 1,
          "from_unit": "GB",
          "to_unit": "GiB"
        },
        "expected": {
          "answer": "0.931323 GiB"
        },
        "check": "By hand: 1 GB = 8,000,000,000 bits; 1 GiB = 8,589,934,592 bits; 8,000,000,000/8,589,934,592 = 0.931322575...; rounded to 6 significant figures is 0.931323."
      },
      {
        "name": "test vector: MiB to KB",
        "inputs": {
          "value": 1,
          "from_unit": "MiB",
          "to_unit": "KB"
        },
        "expected": {
          "answer": "1,048.58 KB"
        },
        "check": "By hand: 1 MiB = 8,388,608 bits; 1 KB = 8000 bits; 8,388,608/8000 = 1048.576 exactly, rounded to 6 significant figures."
      },
      {
        "name": "test vector: byte to bit",
        "inputs": {
          "value": 1,
          "from_unit": "byte",
          "to_unit": "bit"
        },
        "expected": {
          "answer": "8.00000 bit"
        },
        "check": "By definition 1 byte = 8 bits exactly."
      }
    ],
    "disclaimer": null,
    "deck_category": "units"
  },
  "status": "minted",
  "kind": "method",
  "provenanceClass": "own_question",
  "provenance": {
    "schema": "card_provenance/2.0.0",
    "chain": [
      {
        "source": {
          "kind": "standard",
          "value": "IEC 80000-13:2008, Quantities and units - Part 13: Information science and technology",
          "retrieved_utc": "2026-09-30T19:29:48Z"
        },
        "sha256": "24f89fa4165e26d23ddfc971c645ec71615d4cf9c426bbf84d54d2a5683e3dbd",
        "supersedes": null,
        "added_utc": "2026-09-30T22:39:30.722Z",
        "added_by": "method:Data size conversion",
        "why": "the method that computed this answer",
        "check": null,
        "status_label": "pending",
        "signature": null
      }
    ]
  }
}
