Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • npm
  • Socket score

Version published
Maintainers
1
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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc