From a2c43375438f8fda039f5cff014246dffd00413f Mon Sep 17 00:00:00 2001 From: Justin Wind Date: Sat, 18 Mar 2023 12:36:33 -0700 Subject: [PATCH] re-add stashed documentation updates for v2, wups --- CHANGELOG.md | 10 ++++++++-- README.md | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd002db..28408d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,12 @@ Releases and notable changes to this project are documented here. -## [Unreleased] - TBD +## [v2.0.0] - 2023-03-18 + +### Changed + +- *BREAKING CHANGE*: constructor no longer accepts a logger argument. Events are now emitted for the statistics which were the only use of the logger. +- Custom errors are thrown instead of generic. ## [v1.2.2] - 2023-03-14 @@ -98,7 +103,8 @@ Releases and notable changes to this project are documented here. --- -[Unreleased]: https://git.squeep.com/?p=squeep-mystery-box;a=commitdiff;h=HEAD;hp=v1.2.1 +[Unreleased]: https://git.squeep.com/?p=squeep-mystery-box;a=commitdiff;h=HEAD;hp=v2.0.0 +[v2.0.0]: https://git.squeep.com/?p=squeep-mystery-box;a=commitdiff;h=v2.0.0;hp=v1.2.2 [v1.2.2]: https://git.squeep.com/?p=squeep-mystery-box;a=commitdiff;h=v1.2.2;hp=v1.2.1 [v1.2.1]: https://git.squeep.com/?p=squeep-mystery-box;a=commitdiff;h=v1.2.1;hp=v1.2.0 [v1.2.0]: https://git.squeep.com/?p=squeep-mystery-box;a=commitdiff;h=v1.2.0;hp=v1.1.1 diff --git a/README.md b/README.md index b7ad9d4..a8db0a6 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ In our case, this results in a Base64URL encoded string containing a bespoke pac const { MysteryBox } = require('@squeep/mystery-box'); const assert = require('assert'); -const mb = new MysteryBox(console, { +const mb = new MysteryBox({ encryptionSecret: 'very secret', }); @@ -33,3 +33,7 @@ const mb = new MysteryBox(console, { This relies on AEAD ciphers, such as `aes-256-gcm` and `chacha20-poly1305`, to encrypt the payload and authenticate the additional metadata (version identifier, flags indicating payload details, the iv of the cipher, and the salt used to create the key) needed to decrypt the payload. For each box, a new key is generated using the stored secret and a securely-random salt by way of a mechanism such as an XOF such as `shake256`, a hash such as `blake2b512`, or a more time-consuming multi-round hash such as `scrypt`. This key is used to encrypt and authenticate the data and metadata, which is then encoded as a base64url string. + +## Statistics + +A `statistics` event is emitted for every pack or unpack, containing timing and other information. -- 2.45.2