Spaces:
Sleeping
Sleeping
Download gui/frontend/node_modules/eslint/lib/cli-engine/hash.js from BrianLov/guiBackend: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/spaces/BrianLov/guiBackend/resolve/main/gui/frontend/node_modules/eslint/lib/cli-engine/hash.js
- Command line
-
hf download hf://spaces/BrianLov/guiBackend/gui/frontend/node_modules/eslint/lib/cli-engine/hash.js
-
curl -L -o hash.js https://huggingface.co/spaces/BrianLov/guiBackend/resolve/main/gui/frontend/node_modules/eslint/lib/cli-engine/hash.js
1.06 kB
| /** | |
| * @fileoverview Defining the hashing function in one place. | |
| * @author Michael Ficarra | |
| */ | |
| ; | |
| //------------------------------------------------------------------------------ | |
| // 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; | |