{"version":3,"file":"node.mjs","names":["#algorithm","#chunks","ohash","xxHash32Base"],"sources":["../src/digest.ts","../src/etag.ts","../src/murmurhash.ts","../src/hash-files.ts","../src/pbkdf2.ts","../src/xx-hash.ts","../src/hash-content.ts","../src/md5.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n                       🗲 Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/stryke\n Documentation:            https://docs.stormsoftware.com/projects/stryke\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { isSetString } from \"@stryke/type-checks\";\n\nexport type AlgorithmIdentifier = \"SHA-256\" | \"SHA-384\" | \"SHA-512\";\n\n/**\n * Creates a new hash object for the specified algorithm.\n *\n * @param algorithm - The algorithm to use for the hash.\n * @returns A new hash object.\n */\nexport function createHasher(algorithm: AlgorithmIdentifier): Hasher {\n  return new Hasher(algorithm);\n}\n\n/**\n * Creates a new hash object for the specified algorithm.\n *\n * @remarks\n * This function uses the Web Crypto API to create a hash of the input data.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest\n *\n * @param data - The data to hash.\n * @param algorithm - The algorithm to use for the hash.\n * @returns A hash string representation of the `data` parameter.\n */\nexport async function digest(\n  data: string | Uint8Array,\n  algorithm: AlgorithmIdentifier = \"SHA-512\"\n): Promise<string> {\n  const encoder = new TextEncoder();\n  const arrayBuffer = await globalThis.crypto.subtle.digest(\n    algorithm,\n    (isSetString(data) ? encoder.encode(data) : data) as BufferSource\n  );\n\n  return btoa(String.fromCharCode(...new Uint8Array(arrayBuffer)))\n    .replace(/\\+/g, \"-\")\n    .replace(/\\//g, \"_\")\n    .replace(/=/g, \"\");\n}\n\n/**\n * Alias for {@link digest}.\n */\nexport const hash = digest;\n\n/**\n * Hash a string or Uint8Array using SHA-256 and return the result as a base64url-encoded string.\n *\n * @param data - The data to hash.\n * @returns A hash string representation of the `data` parameter.\n */\nexport const sha256 = async (data: string | Uint8Array) =>\n  digest(data, \"SHA-256\");\n\n/**\n * Hash a string or Uint8Array using SHA-384 and return the result as a base64url-encoded string.\n *\n * @param data - The data to hash.\n * @returns A hash string representation of the `data` parameter.\n */\nexport const sha384 = async (data: string | Uint8Array) =>\n  digest(data, \"SHA-384\");\n\n/**\n * Hash a string or Uint8Array using SHA-512 and return the result as a base64url-encoded string.\n *\n * @param data - The data to hash.\n * @returns A hash string representation of the `data` parameter.\n */\nexport const sha512 = async (data: string | Uint8Array) =>\n  digest(data, \"SHA-512\");\n\nexport class Hasher {\n  #chunks: Uint8Array[] = [];\n\n  #algorithm: AlgorithmIdentifier;\n\n  constructor(algorithm: AlgorithmIdentifier) {\n    this.#algorithm = algorithm;\n  }\n\n  update(data: Uint8Array): void {\n    this.#chunks.push(data);\n  }\n\n  async digest(): Promise<Uint8Array> {\n    const data = new Uint8Array(\n      this.#chunks.reduce((acc, chunk) => acc + chunk.length, 0)\n    );\n    let offset = 0;\n    for (const chunk of this.#chunks) {\n      data.set(chunk, offset);\n      offset += chunk.length;\n    }\n    const arrayBuffer = await globalThis.crypto.subtle.digest(\n      this.#algorithm,\n      data\n    );\n\n    return new Uint8Array(arrayBuffer);\n  }\n}\n","/* -------------------------------------------------------------------\n\n                       🗲 Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/stryke\n Documentation:            https://docs.stormsoftware.com/projects/stryke\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * FNV-1a Hash implementation\n *\n * Ported from https://github.com/tjwebb/fnv-plus/blob/master/index.js\n *\n * @remarks\n * Simplified, optimized and add modified for 52 bit, which provides a larger hash space\n * and still making use of Javascript's 53-bit integer space.\n */\nexport const fnv1a52 = (str: string) => {\n  const len = str.length;\n  let i = 0;\n  let t0 = 0;\n  let v0 = 0x2325;\n  let t1 = 0;\n  let v1 = 0x8422;\n  let t2 = 0;\n  let v2 = 0x9ce4;\n  let t3 = 0;\n  let v3 = 0xcbf2;\n\n  while (i < len) {\n    v0 ^= str.charCodeAt(i++);\n    t0 = v0 * 435;\n    t1 = v1 * 435;\n    t2 = v2 * 435;\n    t3 = v3 * 435;\n    t2 += v0 << 8;\n    t3 += v1 << 8;\n    t1 += t0 >>> 16;\n    v0 = t0 & 65535;\n    t2 += t1 >>> 16;\n    v1 = t1 & 65535;\n    v3 = (t3 + (t2 >>> 16)) & 65535;\n    v2 = t2 & 65535;\n  }\n\n  return (\n    (v3 & 15) * 281474976710656 +\n    v2 * 4294967296 +\n    v1 * 65536 +\n    (v0 ^ (v3 >> 4))\n  );\n};\n\n/**\n * Generates an ETag for the given payload.\n *\n * @param payload - The payload to generate an ETag for.\n * @param weak - Whether to generate a weak ETag.\n * @returns The generated ETag.\n */\nexport const generateETag = (payload: string, weak = false) => {\n  const prefix = weak ? 'W/\"' : '\"';\n\n  return `${prefix + fnv1a52(payload).toString(36) + payload.length.toString(36)}\"`;\n};\n","/* -------------------------------------------------------------------\n\n                       🗲 Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/stryke\n Documentation:            https://docs.stormsoftware.com/projects/stryke\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { hash as ohash } from \"ohash\";\n\nexport interface HashOptions {\n  /**\n   * The maximum length of the hash\n   *\n   * @defaultValue 32\n   */\n  maxLength?: number;\n}\n\n/**\n * Use a [MurmurHash3](https://en.wikipedia.org/wiki/MurmurHash) based algorithm to hash any JS value into a string.\n *\n * @see https://github.com/ohash/ohash\n * @see https://en.wikipedia.org/wiki/MurmurHash\n *\n * @param content - The value to hash\n * @param  options - Hashing options\n * @returns A hashed string value\n */\nexport function murmurhash(content: any, options?: HashOptions): string {\n  const result = ohash(content);\n  const maxLength = options?.maxLength ?? 32;\n\n  return result.length > maxLength ? result.slice(0, maxLength) : result;\n}\n","/* -------------------------------------------------------------------\n\n                       🗲 Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/stryke\n Documentation:            https://docs.stormsoftware.com/projects/stryke\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ListOptions } from \"@stryke/fs/list-files\";\nimport { listFiles } from \"@stryke/fs/list-files\";\nimport { readFileIfExisting } from \"@stryke/fs/read-file\";\nimport type { HashOptions } from \"./murmurhash\";\nimport { murmurhash } from \"./murmurhash\";\n\n/**\n * Hash a list of file paths into a string based on the file content\n *\n * @param files - The list of file paths to hash\n * @param  options - Hashing options\n * @returns A hashed string value\n */\nexport async function hashFiles(\n  files: string[],\n  options?: HashOptions\n): Promise<string> {\n  const result = {} as Record<string, string>;\n  await Promise.all(\n    files.map(async file => {\n      result[file] = await readFileIfExisting(file);\n    })\n  );\n\n  return murmurhash(result, options);\n}\n\n/**\n * Hash a folder path into a string based on the file content\n *\n * @param directoryPath - The folder path to hash\n * @param  options - Hashing options. By default, the `node_modules`, `.git`, `.nx`, `.rolldown`, `.vite`, `.next`, `.cache`, `.powerlines`, `.shell-shock`, `.earthquake`, and `tmp` folders are ignored.\n * @returns A hashed string value\n */\nexport async function hashDirectory(\n  directoryPath: string,\n  options: HashOptions & ListOptions = {}\n): Promise<string> {\n  options.ignore = options.ignore ?? [\n    \"**/node_modules/**\",\n    \"**/dist/**\",\n    \"**/tmp/**\",\n    \"**/.git/**\",\n    \"**/.nx/**\",\n    \"**/.rolldown/**\",\n    \"**/.vite/**\",\n    \"**/.next/**\",\n    \"**/.cache/**\",\n    \"**/.powerlines/**\",\n    \"**/.shell-shock/**\",\n    \"**/.earthquake/**\"\n  ];\n\n  return hashFiles(await listFiles(directoryPath, options), options);\n}\n","/* -------------------------------------------------------------------\n\n                       🗲 Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/stryke\n Documentation:            https://docs.stormsoftware.com/projects/stryke\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Hash a password using PBKDF2 (Web Crypto compatible alternative to Argon2) with SHA-256, 100,000 iterations, and a random salt. The resulting hash is formatted as: `$pbkdf2-sha256$iterations$salt$hash`.\n *\n * @remarks\n * This function uses the Web Crypto API to perform password hashing. It generates a random salt for each password, and uses PBKDF2 with SHA-256 and 100,000 iterations to derive a secure hash. The output is a string that includes the algorithm, iteration count, salt, and hash, which can be stored in a database for later verification using the {@link verifyPassword} function.\n *\n * @param password - The password to hash.\n * @returns A promise that resolves to the hashed password string.\n */\nexport async function hashPassword(password: string): Promise<string> {\n  const encoder = new TextEncoder();\n  const salt = crypto.getRandomValues(new Uint8Array(16));\n\n  const keyMaterial = await crypto.subtle.importKey(\n    \"raw\",\n    encoder.encode(password),\n    \"PBKDF2\",\n    false,\n    [\"deriveBits\"]\n  );\n\n  const hash = await crypto.subtle.deriveBits(\n    {\n      name: \"PBKDF2\",\n      salt,\n      iterations: 100000,\n      hash: \"SHA-256\"\n    },\n    keyMaterial,\n    256\n  );\n\n  // Format: $pbkdf2-sha256$iterations$salt$hash\n  const saltB64 = btoa(String.fromCharCode(...salt));\n  const hashB64 = btoa(String.fromCharCode(...new Uint8Array(hash)));\n\n  return `$pbkdf2-sha256$100000$${saltB64}$${hashB64}`;\n}\n\n/**\n * Verify a password against a stored hash in the format produced by {@link hashPassword}.\n *\n * @param password - The password to verify.\n * @param storedHash - The stored hash to verify against.\n * @returns A promise that resolves to true if the password is correct, false otherwise.\n */\nexport async function verifyPassword(\n  password: string,\n  storedHash: string\n): Promise<boolean> {\n  const parts = storedHash.split(\"$\");\n  if (\n    parts.length !== 5 ||\n    parts[1] !== \"pbkdf2-sha256\" ||\n    !parts[2] ||\n    !parts[3] ||\n    !parts[4]\n  ) {\n    return false;\n  }\n\n  const iterations = Number.parseInt(parts[2], 10);\n  const salt = Uint8Array.from(atob(parts[3]), c => c.charCodeAt(0));\n  const expectedHash = parts[4];\n\n  const encoder = new TextEncoder();\n  const keyMaterial = await crypto.subtle.importKey(\n    \"raw\",\n    encoder.encode(password),\n    \"PBKDF2\",\n    false,\n    [\"deriveBits\"]\n  );\n\n  const hash = await crypto.subtle.deriveBits(\n    {\n      name: \"PBKDF2\",\n      salt,\n      iterations,\n      hash: \"SHA-256\"\n    },\n    keyMaterial,\n    256\n  );\n\n  return btoa(String.fromCharCode(...new Uint8Array(hash))) === expectedHash;\n}\n","/* -------------------------------------------------------------------\n\n                       🗲 Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/stryke\n Documentation:            https://docs.stormsoftware.com/projects/stryke\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { xxHash32 as xxHash32Base } from \"js-xxhash\";\n\n/**\n * xxHash32 only computes 32-bit values. Run it n times with different seeds to\n * get a larger hash with better collision resistance.\n *\n * @param content - The string to hash\n * @param words - The number of 32-bit words to hash\n * @returns A 128-bit hash\n */\nfunction _xxHash32(content: string, words: number): bigint {\n  let hash = 0n;\n  for (let i = 0; i < words; i++) {\n    hash = (hash << 32n) + BigInt(xxHash32Base(content, i));\n  }\n  return hash;\n}\n\nexport const xxHash32 = (s: string) => xxHash32Base(s, 0);\nexport const xxHash64 = (s: string) => _xxHash32(s, 2);\nexport const xxHash128 = (s: string) => _xxHash32(s, 4);\n","/* -------------------------------------------------------------------\n\n                       🗲 Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/stryke\n Documentation:            https://docs.stormsoftware.com/projects/stryke\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { canonicalJson } from \"@stryke/json/canonical\";\nimport { sha256 } from \"./neutral\";\n\n/**\n * Hash the content of a PDU (Protocol Data Unit) by removing the `signatures` and `unsigned` fields, then hashing the remaining content using SHA-256 and encoding it as a base64url string. This function is useful for generating a consistent hash of the PDU content that can be used for integrity verification or caching purposes, while ignoring any fields that may change due to signatures or unsigned data.\n *\n * @param content - The PDU content to hash, represented as a record of string keys and unknown values.\n * @returns A promise that resolves to a base64url-encoded string representing the hash of the PDU content.\n */\nexport async function hashContent(\n  content: Record<string, unknown>\n): Promise<string> {\n  // Remove signatures and unsigned before hashing\n  const toHash = { ...content };\n  delete toHash.signatures;\n  delete toHash.unsigned;\n\n  return sha256(canonicalJson(toHash));\n}\n\n/**\n * Verify the hash of a PDU (Protocol Data Unit) content by hashing the content using the {@link hashContent} function and comparing it to an expected hash value. This function is useful for validating the integrity of the PDU content by ensuring that the computed hash matches the expected hash, which can be used to detect any tampering or corruption of the content.\n *\n * @param content - The PDU content to verify, represented as a record of string keys and unknown values.\n * @param expectedHash - The expected hash value to compare against, represented as a string.\n * @returns A promise that resolves to a boolean indicating whether the computed hash of the content matches the expected hash value (true if they match, false otherwise).\n */\nexport async function verifyContent(\n  content: Record<string, unknown>,\n  expectedHash: string\n): Promise<boolean> {\n  const actualHash = await hashContent(content);\n\n  return actualHash === expectedHash;\n}\n","/* -------------------------------------------------------------------\n\n                       🗲 Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website:                  https://stormsoftware.com\n Repository:               https://github.com/storm-software/stryke\n Documentation:            https://docs.stormsoftware.com/projects/stryke\n Contact:                  https://stormsoftware.com/contact\n\n SPDX-License-Identifier:  Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { createHash } from \"node:crypto\";\n\n/**\n * Generate an MD5 hash of the provided content.\n *\n * @param content - The content to hash.\n * @param length - The length of the hash to return.\n * @returns The generated MD5 hash.\n */\nexport function md5(content: string, length = 32) {\n  return createHash(\"md5\").update(content).digest(\"hex\").slice(0, length);\n}\n"],"mappings":";;;;;;;;;;;;;;;AA4BA,SAAgB,aAAa,WAAwC;AACnE,QAAO,IAAI,OAAO,UAAU;;;;;;;;;;;;;;AAe9B,eAAsB,OACpB,MACA,YAAiC,WAChB;CACjB,MAAM,UAAU,IAAI,aAAa;CACjC,MAAM,cAAc,MAAM,WAAW,OAAO,OAAO,OACjD,WACC,YAAY,KAAK,GAAG,QAAQ,OAAO,KAAK,GAAG,KAC7C;AAED,QAAO,KAAK,OAAO,aAAa,GAAG,IAAI,WAAW,YAAY,CAAC,CAAC,CAC7D,QAAQ,OAAO,IAAI,CACnB,QAAQ,OAAO,IAAI,CACnB,QAAQ,MAA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