Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.11 KB

README.md

File metadata and controls

44 lines (33 loc) · 1.11 KB

string-hashcode

NPM version build status Test coverage

Extra utilities for string.

Install

npm install string-hashcode

Example

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);

API

hashCode(str)

params:

  • str: string object

return:

Number: hash code

Return a hash code of a string. Note that a hash code is immutable with a certain string.

Lisence

MIT