UNPKG

short-hash

Version:

Get a short hash from a string. Uses Bernstein's popular 'times 33' hash algorithm but returns a hex string instead of a number

7 lines (5 loc) 129 B
'use strict'; var hash = require('hash-string'); module.exports = function shortHash(str) { return hash(str).toString(16); };