Skip to content

Commit ad75c78

Browse files
tniessentargos
authored andcommitted
doc: add note about timingSafeEqual for TypedArray
PR-URL: #36323 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 27260c7 commit ad75c78

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/api/crypto.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -3383,7 +3383,11 @@ comparing HMAC digests or secret values like authentication cookies or
33833383
[capability urls](https://www.w3.org/TR/capability-urls/).
33843384

33853385
`a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they
3386-
must have the same length.
3386+
must have the same byte length.
3387+
3388+
If at least one of `a` and `b` is a `TypedArray` with more than one byte per
3389+
entry, such as `Uint16Array`, the result will be computed using the platform
3390+
byte order.
33873391

33883392
Use of `crypto.timingSafeEqual` does not guarantee that the *surrounding* code
33893393
is timing-safe. Care should be taken to ensure that the surrounding code does

0 commit comments

Comments
 (0)