Skip to content

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

Notifications You must be signed in to change notification settings

joakimbeng/short-hash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

short-hash

NPM version js-xo-style

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

This is just a convenient wrapper around hash-string.

Installation

Install short-hash using npm:

npm install --save short-hash

Usage

Module usage

var shortHash = require('short-hash');

shortHash('a string to hash...');
// "5e687236"

API

shortHash(str)

Name Type Description
str String The string to hash

Returns: String, a hexadecimal string.

License

MIT

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •