mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
* [@types/morgan] Fix tests
* @types/node: Fix crypto input and output encoding
There is a mismatch in supported encodings when trying to call Hmac.update() with a base64 encoded string:
const message = Buffer.from('message').toString('base64');
crypto.createHmac('sha256', 'key').update(message, 'base64').digest();
On further investigation, it seems that the same issue is present all over the module.
I renamed the encoding types according to the terminology used in the NodeJS documentation:
- BinaryToTextEncoding
- CharacterEncoding
- LegacyCharacterEncoding
* @types/blake2: Fix crypto import
* @types/dkim-signer: Fix crypto import
Co-authored-by: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>