accumulator-hash
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/accumulator-hash package

1.0.0 • Public • Published

accumulator-hash

Hash and xor to generate unique byte strings

IMPORTANT: This is not intended to be a cryptographically-secure, but rather a convenience class for generating unique references.

Usage

const State = require('accumulator-hash')

const input = Buffer.from('hello, world!')
const state = new State()

const a = state.hash(input)
const b = state.hash(input)
const c = state.hash(input)

// a !== b !== c

API

const state = new State([init])

Instantiate a new state. init can be supplied to initialise the state buffer. If it is not supplied, a random init buffer is generated.

const hash = state.hash(data)

Hash some data.

Readme

Keywords

none

Package Sidebar

Install

npm i accumulator-hash

Weekly Downloads

21

Version

1.0.0

License

ISC

Unpacked Size

2.49 kB

Total Files

4

Last publish

Collaborators

  • chm-diederichs