@rabbit-company/blake2b
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

Blake2b-JS

Blake2b-512 implementation in JavaScript (ES6).

Usage

1. Download library

npm i --save @rabbit-company/blake2b

2. Import library

import Blake2b from "@rabbit-company/blake2b";

3. Hash

/*

  Parameters:
  1. Message (String or Uint8Array)
  2. Secret (String or Uint8Array | undefined) <>
  3. Length (Int) <64> (Min = 0 and Max = 64)
  4. Salt (String or Uint8Array) <> (String with length 16 or Uint8Array)
  5. Personal (String or Uint8Array) <> (String with length 16 or Uint8Array)

*/

// Generate hash from the provided message
Blake2b.hash("message");

// Generate hash from the provided message and secret key
Blake2b.hash("message", "secretKey");

// Generate hash from the provided message, secret key and length
Blake2b.hash("message", "secretKey", 32);

// Generate hash from the provided message, secret key, length and salt
Blake2b.hash("message", "secretKey", 32, "c32df5f2f3c77a03");

// Generate hash from the provided message, secret key, length, salt and personal
Blake2b.hash("message", "secretKey", 32, "c32df5f2f3c77a03", "4862f0260a9803da");

Package Sidebar

Install

npm i @rabbit-company/blake2b

Weekly Downloads

31

Version

2.0.0

License

MIT

Unpacked Size

12.9 kB

Total Files

5

Last publish

Collaborators

  • ziga.zajc007