@matters/passphrases
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-alpha.9 • Public • Published

Passphrases

Introduction

TODO

Usage

npm i @matters/passphrases
import { generate, verify } from '@matters/passphrases'

// load default dict or use your custom dict
import { loadDict, loadIndexDict } from '@matters/passphrases/dict'
const dict = loadDict()
const indexDict = loadIndexDict()

// generate and take the first 6 words as passphrases
const passphrases = generate({
  sigPayload: { email: 'test@example' },
  sigExp: 1693036368286,
  sigSecret: 'abc',
  sigDict: dict,
  expDict: dict,
})

// verify passphrases
const isValid = verify({
  passphrases,
  sigPayload: { email: 'test@example' },
  sigSecret: 'abc',
  sigDict: dict,
  expDict: dict,
  expIndexDict: indexDict,
})

Development

# build
npm run build

# test
npm run test

# build your own dictionary
npm run build:dict

# shuffle the dictionary to make it more secure
npm run shuffle:dict

Benchmark

npm run benchmark

Package Sidebar

Install

npm i @matters/passphrases

Weekly Downloads

0

Version

0.0.1-alpha.9

License

MIT

Unpacked Size

87.5 kB

Total Files

17

Last publish

Collaborators

  • guoliu11
  • robermac
  • devformatters
  • matters_npm