New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@theqrl/hashchains

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@theqrl/hashchains

hashchains utilities

  • 0.6.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@theqrl/hashchains

Coverage Status Build Status Codacy Badge npm (scoped) NPM

There's a live demo on Codepen to show the package in use.

Browser bundle at dist/hashchains-browser.js

Modules in dist but installing the npm release and import/requiring @theqrl/hashchains should work with modern toolsets, i.e:

npm install @theqrl/hashchains
import { HashChain, HashChains } from '@theqrl/hashchains'

Exposes two classes:

1. HashChain

const hc = new HashChain(hashRoot, hashFunction, length)

hashRoot (string)

required

The hash of (secret data + index) which forms the first hash in the chain and is iteratively hashed.

hashFunction (string)

optional, default 'keccack256'

Currently only keccak256 is implemented.

length

optional, default 64

Number of hashes to generate in the chain.

2. HashChains

const hc = new HashChains(mnemonic, numberToCreate, index, hashFunction, length)

mnemomic

required

Secret data (eg. BIP39 mnemonic or hexstring) which is hashed along with sequential index to be the start of the hashchains.

numberToCreate

optional, default 2

Number of hashchains to return

index

optional, default 0

Starting index for hashchains. Starting at index 0 and generating 10 chains then starting at index 8 and generating 5 chains will create two overlapping (i.e. identical) hashchains.

hashFunction (string)

optional, default 'keccack256'

Currently only keccak256 is implemented.

length

optional, default 64

Number of hashes to generate per chain created.

Also in this repository

After an npm install:

Live demo

npm run serve

Starts a local vue development environment serving the browser-based demo from the CodePen above. This may be useful in adding more functionality/hash functions.

Tests

npm run test

Dev environment

npm run dev

Runs a watched for continuous development: lint code as per repository standards and ensure test cases pass.

Build

npm run build

Outputs cjs/umd/esm and browserified JS modules to dist/ directory.

Keywords

FAQs

Package last updated on 22 May 2021

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