Files
med-notes/.pnpm-store/v10/files/b9/95600131163e755df45d0256e93e20c0c1d551c948df329d7b47ebe58a2c626fa6ee8b3ce600083c986ca857bcc5ef2224befde05b4e22af9f91614ef9aa41
2025-05-09 05:30:08 +02:00

36 lines
1.0 KiB
Plaintext

/**
* @fileoverview Defining the hashing function in one place.
* @author Michael Ficarra
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const murmur = require("imurmurhash");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Private
//------------------------------------------------------------------------------
/**
* hash the given string
* @param {string} str the string to hash
* @returns {string} the hash
*/
function hash(str) {
return murmur(str).result().toString(36);
}
//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------
module.exports = hash;