mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-05 19:41:12 +08:00
This pulls in version 8, which covers numerous breaking changes. Most notably, the `CLIEngine` class has been removed, for which we should now use `ESLint`. R=jacktfranklin@chromium.org Bug: none Change-Id: I3b64600e690f073d4db19fb34539db7200f3b561 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3268298 Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
36 lines
1.0 KiB
JavaScript
36 lines
1.0 KiB
JavaScript
/**
|
|
* @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;
|