{
  "id": "node-crypto-hash-random-table",
  "kind": "table",
  "slug": "node-crypto-hash-random",
  "iil_id": null,
  "note_url": "https://iinventedlight.com/library/notes/node-crypto-hash-random/",
  "title": "Node.js crypto basics - hashes, HMAC, random UUIDs and constant-time comparison",
  "columns": [
    "name",
    "source",
    "detail"
  ],
  "rows": [
    {
      "name": "randomUUID()",
      "source": "Node.js API docs",
      "detail": "generates a random RFC 4122 version 4 UUID using a cryptographic pseudorandom number generator. Node.js caches enough random data for up to 128 UUIDs; set disableEntropyCache: true to skip the cache."
    },
    {
      "name": "randomBytes(size)",
      "source": "Node.js API docs",
      "detail": "returns a Buffer synchronously, or calls callback(err, buf) asynchronously if you pass one."
    },
    {
      "name": "randomInt(min, max)",
      "source": "Node.js API docs",
      "detail": "returns n with min <= n < max and avoids modulo bias; the range must be less than 2^48."
    },
    {
      "name": "Hmac",
      "source": "Node.js API docs",
      "detail": "objects are created with createHmac(), not with the new keyword."
    }
  ],
  "related_slugs": [
    "node-process-and-console",
    "node-esm",
    "node-http-and-url"
  ],
  "license": "CC-BY-4.0",
  "source_license": "MIT (Node.js API docs); MIT (nodejs/node (GitHub)); prose restates cited source lines in own words",
  "as_of": "2026-11-18",
  "status": "fill-draft-20261118",
  "note": "Restated from the note's GREEN sources; check those sources before relying on a value."
}