{
  "address": "2a6b2f945185274daf52b4c4e4beefd4",
  "category": "other",
  "question": "What is FF (base 16) written in base 10?",
  "answer": "255",
  "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": "The Art of Computer Programming, Vol. 2 (positional number systems)",
      "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": "edition_page",
    "value": "Knuth, Donald E. The Art of Computer Programming, Volume 2: Seminumerical Algorithms, 3rd ed. Addison-Wesley, 1997, section 4.1 (Positional Number Systems).",
    "retrieved_utc": "2026-09-30T20:00:00Z"
  },
  "qsha256": "ed25a5ba57242698a0fc77e89eb9244940cdb660bca45048823c93348c25896e",
  "runOne": null,
  "cardContractVersion": "card_contract/1",
  "deck_id": "method-deck",
  "deck_title": "Method Deck",
  "method": {
    "name": "Number base conversion",
    "version": "1",
    "source_url_or_file": "methods/number-base-conversion.cjs",
    "sha256_of_method_file": "798333a38816f8fa7a727b22124243f109a4547881b2efe91fb7bf6ba0dfb9be"
  },
  "receipt": {
    "inSubstrate": false,
    "local": true,
    "modelCallsAtMint": 0,
    "tokensAtMint": 0
  },
  "method_deck": {
    "inputs": [
      {
        "name": "value",
        "type": "string",
        "required": true,
        "description": "The number to convert, as digits/letters valid in from_base."
      },
      {
        "name": "from_base",
        "type": "integer",
        "required": true,
        "description": "Base of the input value.",
        "min": 2,
        "max": 36
      },
      {
        "name": "to_base",
        "type": "integer",
        "required": true,
        "description": "Base to convert the value into.",
        "min": 2,
        "max": 36
      }
    ],
    "outputs": [
      {
        "name": "result",
        "description": "value represented in to_base, using digits 0-9 then letters A-Z for digits above 9."
      }
    ],
    "steps": [
      "Positional notation: a number in base b is a sum of digit_i * b^i, where digits range from 0 to b-1 and digits above 9 are written as letters A (10) through Z (35).",
      "Parse value as an integer in from_base to get its numeric value.",
      "Re-express that numeric value in to_base, most significant digit first, using the same digit/letter convention.",
      "Digits/letters in the output are uppercase."
    ],
    "constants": [],
    "examples": [
      {
        "name": "worked example",
        "inputs": {
          "value": "FF",
          "from_base": 16,
          "to_base": 10
        },
        "expected": {
          "answer": "255"
        },
        "check": "By hand: hex FF = 15*16 + 15 = 240 + 15 = 255, a well known hexadecimal fact."
      },
      {
        "name": "test vector: decimal to binary",
        "inputs": {
          "value": "255",
          "from_base": 10,
          "to_base": 2
        },
        "expected": {
          "answer": "11111111"
        },
        "check": "255 = 2^8 - 1, the well known fact that eight binary 1s equal 255, i.e. 11111111 in binary."
      }
    ],
    "disclaimer": null,
    "deck_category": "other"
  },
  "status": "minted",
  "kind": "method",
  "provenanceClass": "own_question",
  "provenance": {
    "schema": "card_provenance/2.0.0",
    "chain": [
      {
        "source": {
          "kind": "edition_page",
          "value": "Knuth, Donald E. The Art of Computer Programming, Volume 2: Seminumerical Algorithms, 3rd ed. Addison-Wesley, 1997, section 4.1 (Positional Number Systems).",
          "retrieved_utc": "2026-09-30T20:00:00Z"
        },
        "sha256": "4d88e5b24764ad257fc1ed3fb3660b9afa40cde9e59a9994c484ff9dadb6f195",
        "supersedes": null,
        "added_utc": "2026-09-30T22:39:30.722Z",
        "added_by": "method:Number base conversion",
        "why": "the method that computed this answer",
        "check": null,
        "status_label": "pending",
        "signature": null
      }
    ]
  }
}
