diff --git a/src/core/to-hash.js b/src/core/to-hash.js index 569b9bf0..3996b43e 100644 --- a/src/core/to-hash.js +++ b/src/core/to-hash.js @@ -7,9 +7,5 @@ * @param {String} str * @returns {String} */ -export let toHash = (str) => { - let i = 0, - out = 11; - while (i < str.length) out = (101 * out + str.charCodeAt(i++)) >>> 0; - return 'go' + out; -}; +export let toHash = (str) => + 'go' + [...str].reduce((out, char) => (101 * out + char.charCodeAt(0)) >>> 0, 11);