0.3.2 • Published 9 months ago

@pacote/xxhash v0.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@pacote/xxhash

version minified minified + gzip

Fast non-cryptographic hashing algorithm.

Installation

yarn add @pacote/xxhash

Usage

import { xxh64 } from '@pacote/xxhash'

const hasher = xxh64(2654435761)

hasher.update('data').digest('hex') // => '5014607643a9b4c3'

xxh64(seed?: number | U64): XXHash

xxh64() creates a XXHash64 hasher instance with an optional seed. If not provided, the seed value is 0.

XXHash#update(data: string | ArrayBuffer): XXHash

Updates the hasher state with data from a string or buffer to hash.

The hasher instance is returned for chaining other methods.

XXHash#digest(encoding: 'hex'): string

Outputs the hexadecimal hash of the provided data. The only encoding value allowed at this time is 'hex'.

XXHash#reset(seed?: number | U64): void

Resets the hasher state with an optional seed. If a seed is not provided, then the value remains the one used the last time the hasher was either created or reset.

License

MIT © Luís Rodrigues.

0.3.2

9 months ago

0.3.0

1 year ago

0.2.7

1 year ago

0.3.1

1 year ago

0.2.6

2 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago