JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 146
  • Score
    100M100P100Q82807F
  • License MIT

Fast non-cryptographic hashing algorithm.

Package Exports

  • @pacote/xxhash

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@pacote/xxhash) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@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.