Skip to content

Releases: dchest/blake2s-js

v1.3.0

06 Aug 10:41
Compare
Choose a tag to compare

Added TypeScript type definitions (thanks to @lostfictions)

v1.2.2

09 Feb 23:49
v1.2.2
Compare
Choose a tag to compare

Made it two times faster (at least in Chrome/V8 and Firefox). That is all.

v1.2.1

29 Dec 19:07
v1.2.1
Compare
Choose a tag to compare
  • Fixed config validation: instance constructor was supposed to check that key, salt, and personalization were Uint8Array or Array and throw otherwise, however due to an error this check didn't work.
  • Use The Unlicense for public domain dedication.

v1.2.0 — Salting and personalization support

09 May 17:11
Compare
Choose a tag to compare

To create salted and/or personalized hash instance, you can now pass a config object to BLAKE2s constructor instead of key (passing just key is still supported) with the following optional fields:

{
    salt: // 8-byte Uint8Array or Array of bytes
    personalization: // 8-byte Uint8Array or Array of bytes
    key: // 0-32-byte Uint8Array or Array of bytes
}

If present, salt and personalization must each have exactly 8 bytes, while key field, as previously, can have from 0 to 32 bytes (it will be zero-padded if has fewer than 32 bytes).

Examples

Salting and personalizing:

var randomSalt = new Uint8Array(BLAKE2.saltLength);
window.crypto.getRandomValues(randomSalt);
var h = new BLAKE2s(32, {
   salt: randomSalt,
   personalization: Uint8Array([1, 0, 0, 0, 0, 0, 0, 0])
});
...

Passing just a key still works:

var key = new Uint8Array(BLAKE2s.keyLength);
window.crypto.getRandomValues(key);
var h = new BLAKE2s(32, key);
...

If config contains unknown key, an error will be thrown. This is helpful to protect against misspellings.

v1.1.0

21 Mar 09:53
Compare
Choose a tag to compare

update() now returns this instance to enable method chaining:

var digest = (new BLAKE2s()).update(data).digest();

v1.0.3

11 Sep 15:37
Compare
Choose a tag to compare
  • Fixed digestLength range check.
  • Added BLAKE2s.keyLength constant.

v1.0.0

11 Sep 15:09
Compare
Choose a tag to compare

Initial release