Skip to content

jo32/non-crypto-hash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Non-Cryptographic Hash

This package contains non-crypographic hash functions worked in both browser and Node.js:

  1. SuperFastHash
  2. MurmurHash 3

Installation

npm install non-crypto-hash

Usage

var nch = require('non-crypto-hash');
// var algo = nch.createHash('superfasthash');
var algo = nch.createHash('murmurhash3');
console.log(algo.hash('string'));

API

SuperFastHash

superfasthash.hash(inputString) {...}

create hash of inputString in 32bits hex string.

MurmurHash3

MurmurHash3.hash(inputString[, seed]) {...}

alias for MurmurHash3.x64Hash128

MurmurHash3.x86Hash32(inputString[, seed]) {...}

create hash of inputString in 32bits hex string, seed is default to 0.

MurmurHash3.x86Hash64(inputString[, seed]) {...}

create hash of inputString in 64bits hex string, seed is default to 0. returning value is the lower 64bits of MurmurHash3.x86Hash128

MurmurHash3.x86Hash128(inputString[, seed]) {...}

create hash of inputString in 128bits hex string, seed is default to 0.

MurmurHash3.x64Hash64(inputString[, seed]) {...}

create hash of inputString in 64bits hex string, seed is default to 0. returning value is the lower 64bits of MurmurHash3.x64Hash128

MurmurHash3.x64Hash128(inputString[, seed]) {...}

create hash of inputString in 128bits hex string, seed is default to 0.

About

This package contains non-crypographic hash functions worked in both browser and Node.js: 1) SuperFastHash 2) MurmurHash

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published