Sha256: 96589233d547a6ce039dbf1a067214dd89ec02de6ca0057badb76780a01b478c

Contents?: true

Size: 1.04 KB

Versions: 44

Compression:

Stored size: 1.04 KB

Contents

/**
 * @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;

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
govuk_publishing_components-18.0.0 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.21.0 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.20.0 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.19.1 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.19.0 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.18.0 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.17.0 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.16.0 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.15.0 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.14.0 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.13.0 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.12.2 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.12.1 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.12.0 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.11.0 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.10.0 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.9.0 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.8.0 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.7.0 node_modules/standard/node_modules/eslint/lib/util/hash.js
govuk_publishing_components-17.6.1 node_modules/standard/node_modules/eslint/lib/util/hash.js