Extra utilities for string.
npm install string-hashcode
var hashCode = require('string-hashcode');
var s = 'abc';
console.log(s.hashCode); // undefined
var code = hashCode(s);
console.log(s.hashCode); // Function
var code2 = s.hashCode();
assert.equal(code, code2);
- str: string object
Number: hash code
Return a hash code of a string. Note that a hash code is immutable with a certain string.
MIT