Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 1.23 KB

README.md

File metadata and controls

59 lines (40 loc) · 1.23 KB

dumbjs/quick-hash

Why?

Tired of copying them around

Usage

The library exports a few quick string hashing functions that are widely used for proper bit distribution and short hashes for longer strings, (with the exception of the BigInt implementation of sdbm)

djb2

Details →

import { djb2 as hash } from "@dumbjs/quick-hash";
// or
// import { djb2 as hash } from '@dumbjs/quick-hash/djb2'

hash('hello') //=>261238937

sdbm

Details →

Original Version

import { sdbm as hash } from '@dumbjs/quick-hash'
// or
// import { sdbm as hash } from '@dumbjs/quick-hash/sdbm'

hash('hello') //=>31334377934759990

GAWK Version

import { sdbmGawk as hash } from '@dumbjs/quick-hash'
// or
// import { sdbmGawk as hash } from '@dumbjs/quick-hash/sdbm'

hash('hello') //=>1925877435333486942514

License

MIT