{
  "slug": "gear-hash",
  "term": "Gear hash",
  "aliases": [
    "Gear fingerprint"
  ],
  "definition": "Gear hash is a rolling fingerprint based on a byte-indexed table and a shift-and-add recurrence, used in content-defined boundary selection.",
  "note": "The FastCDC paper describes a left-shift recurrence with finite-width arithmetic and explains how mask placement changes the input history visible to a boundary test. The number of selected bits and their positions serve different roles; a boundary fingerprint is not a cryptographic identifier of the whole chunk. [fastcdc]\n\nVariants matter: fastcdc-py 1.7.0 uses p_next = floor(p/2) + g. From zero on one repeated byte with g > 0, p_t = 2g - ceil(2g / 2^t), eventually reaching the odd state 2g - 1. Its low-bit zero masks cannot pass after settling, though transient matches remain possible. [implementation] [repeated-study]\n\nAt 2048/8192/65536 B parameters, the 256 separate 131073-byte constant-byte fixtures produce maximum-sized chunks for 255 byte values; 0x5D instead yields 63 chunks of 2070 B and a 663 B tail. Exact reconstruction and independent recurrence checks support this bounded result, not a general FastCDC performance or storage-savings claim. [repeated-study]",
  "related": [
    "rolling-hash",
    "fastcdc",
    "content-defined-chunking",
    "deduplication"
  ],
  "citations": [
    {
      "id": "fastcdc",
      "title": "Xia et al. FastCDC: a Fast and Efficient Content-Defined Chunking Approach for Data Deduplication. USENIX ATC 2016, sections 3-4.",
      "url": "https://www.usenix.org/system/files/conference/atc16/atc16-paper-xia.pdf",
      "accessed": "2026-10-20"
    },
    {
      "id": "implementation",
      "title": "ISCC. fastcdc-py v1.7.0: cdc_offset, masks and Gear table.",
      "url": "https://github.com/iscc/fastcdc-py/blob/v1.7.0/fastcdc/fastcdc_py.py",
      "accessed": "2026-10-20"
    },
    {
      "id": "repeated-study",
      "title": "Hesela. Exhaustive constant-byte FastCDC experiment: pinned 1.7.0 Python API, source hashes, exact reconstruction and independent recurrence checks.",
      "url": "https://hesela.dev/research/gear-repeated/results.json",
      "accessed": "2026-10-20"
    },
    {
      "id": "hesela-cdc",
      "title": "Hesela. Content-defined chunking: boundaries are not identity.",
      "url": "https://hesela.com/analyses/content-defined-chunking-boundaries/#repeated-bytes",
      "accessed": "2026-10-20"
    }
  ],
  "status": "shipping",
  "advantages": [],
  "limitations": [
    "A fingerprint's recurrence, integer width, table and boundary masks must be specified to reproduce behavior."
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-20"
}
