]> git.proxmox.com Git - pve-eslint.git/blame - eslint/lib/cli-engine/hash.js
import 8.3.0 source
[pve-eslint.git] / eslint / lib / cli-engine / hash.js
CommitLineData
eb39fafa
DC
1/**
2 * @fileoverview Defining the hashing function in one place.
3 * @author Michael Ficarra
4 */
5
6"use strict";
7
8//------------------------------------------------------------------------------
9// Requirements
10//------------------------------------------------------------------------------
11
12const murmur = require("imurmurhash");
13
14//------------------------------------------------------------------------------
15// Helpers
16//------------------------------------------------------------------------------
17
18//------------------------------------------------------------------------------
19// Private
20//------------------------------------------------------------------------------
21
22/**
23 * hash the given string
609c276f
TL
24 * @param {string} str the string to hash
25 * @returns {string} the hash
eb39fafa
DC
26 */
27function hash(str) {
28 return murmur(str).result().toString(36);
29}
30
31//------------------------------------------------------------------------------
32// Public Interface
33//------------------------------------------------------------------------------
34
35module.exports = hash;