Socket
Book a DemoInstallSign in
Socket

accumulator-hash

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

accumulator-hash

Generate unique references

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
20
42.86%
Maintainers
1
Weekly downloads
 
Created
Source

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.

FAQs

Package last updated on 26 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.