From 218f46c682f29782d9fca99d6d1ba036e687dc09 Mon Sep 17 00:00:00 2001 From: Alex Agranov Date: Thu, 13 Jan 2022 16:49:37 -0700 Subject: [PATCH 1/2] doc: update timingSafeEqual error case --- doc/api/crypto.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index f2271f32d9f104..f911544a8ab4e9 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -5276,7 +5276,8 @@ comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/). `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they -must have the same byte length. +must have the same byte length. An error is returned if `a` and `b` have +different byte lengths. If at least one of `a` and `b` is a `TypedArray` with more than one byte per entry, such as `Uint16Array`, the result will be computed using the platform From c74c8b2aa43aca18c4d80fcd8215248efa79e97f Mon Sep 17 00:00:00 2001 From: Alex Agranov Date: Thu, 13 Jan 2022 16:57:51 -0700 Subject: [PATCH 2/2] More accurate wording. --- doc/api/crypto.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index f911544a8ab4e9..c6f8e99834600b 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -5276,7 +5276,7 @@ comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/). `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they -must have the same byte length. An error is returned if `a` and `b` have +must have the same byte length. An error is thrown if `a` and `b` have different byte lengths. If at least one of `a` and `b` is a `TypedArray` with more than one byte per