Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

sdbm

sindresorhus68.9kMIT2.0.0TypeScript support: included

SDBM non-cryptographic hash function

sdbm, algorithm, hash, hashing, string, function

readme

sdbm

SDBM non-cryptographic hash function

SDBM has good distribution and collisions are rare.

Install

$ npm install sdbm

Usage

import sdbm from 'sdbm';

sdbm('🦄🌈');
//=> 4053542802

It returns the hash as a positive integer.

  • fnv1a - FNV-1a non-cryptographic hash function
  • djb2a - DJB2a non-cryptographic hash function