{
  "version": 3,
  "sources": ["../src/main.ts"],
  "sourcesContent": ["/**\n * DJB2 hash algorithm but faster!\n *\n * This implementation is based on Daniel J. Bernstein's popular 'times 33' hash algorithm,\n * commonly known as DJB2. It's known for its simplicity, speed, and good distribution properties\n * for short strings, making it suitable for general purpose hashing needs.\n *\n * Performance improvements in this version:\n * - Uses right-to-left iteration to avoid repeated length lookups\n * - Employs bit shifting operations for faster computation\n * - Final right shift ensures unsigned 32-bit integer output\n *\n * @param {string} str - The input string to be hashed\n * @returns {number} A 32-bit unsigned integer hash value\n *\n * @example\n * // Returns a numeric hash value\n * const hashValue = djb2Hash(\"hello world\");\n */\nexport function djb2Hash(str: string): number {\n  // 5381 is a prime number used as initial value in the DJB2 algorithm\n  let hashValue = 5381;\n\n  // Reverse loop for better performance - avoids repeated length property lookup\n  for (let i = str.length - 1; i >= 0; i--) {\n    // Using left shift (*2) and addition instead of multiplication by 33\n    // (hash * 33) is equivalent to ((hash << 5) + hash)\n    hashValue = ((hashValue << 5) + hashValue) ^ str.charCodeAt(i);\n  }\n\n  return hashValue >>> 0;\n}\n"],
  "mappings": ";;qqBAAA,6GAmBO,SAAS,SAAS,IAAqB,CAE5C,IAAI,UAAY,KAGhB,QAAS,EAAI,IAAI,OAAS,EAAG,GAAK,EAAG,IAAK,CAGxC,WAAc,WAAa,GAAK,UAAa,IAAI,WAAW,CAAC,CAC/D,CAEA,OAAO,YAAc,CACvB",
  "names": []
}
