@dumbjs/quick-hash@0.0.7Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
dumbjs/quick-hashQuick non-cryptographic hash functions for strings
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




JSR Score
70%
Published
4 months ago (0.0.7)
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
import { djb2 as hash } from '@dumbjs/quick-hash' // or // import { djb2 as hash } from '@dumbjs/quick-hash/djb2' hash('hello') //=>261238937
sdbm
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
Built and signed on
GitHub Actions
Add Package
deno add jsr:@dumbjs/quick-hash
Import symbol
import * as quick_hash from "@dumbjs/quick-hash";
Import directly with a jsr specifier
import * as quick_hash from "jsr:@dumbjs/quick-hash";
Add Package
pnpm i jsr:@dumbjs/quick-hash
pnpm dlx jsr add @dumbjs/quick-hash
Import symbol
import * as quick_hash from "@dumbjs/quick-hash";
Add Package
yarn add jsr:@dumbjs/quick-hash
yarn dlx jsr add @dumbjs/quick-hash
Import symbol
import * as quick_hash from "@dumbjs/quick-hash";
Add Package
vlt install jsr:@dumbjs/quick-hash
Import symbol
import * as quick_hash from "@dumbjs/quick-hash";
Add Package
npx jsr add @dumbjs/quick-hash
Import symbol
import * as quick_hash from "@dumbjs/quick-hash";
Add Package
bunx jsr add @dumbjs/quick-hash
Import symbol
import * as quick_hash from "@dumbjs/quick-hash";