GeezerVison is showing github.com — doc: add note about timingSafeEqual for TypedArray · nodejs/node@6198d74
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/crypto.md +5-1Lines changed: 5 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3068,7 +3068,11 @@ comparing HMAC digests or secret values like authentication cookies or |
3068 | 3068 | [capability urls](https://www.w3.org/TR/capability-urls/). |
3069 | 3069 |
|
3070 | 3070 | `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they |
3071 | | -must have the same length. |
| 3071 | +must have the same byte length. |
| 3072 | + |
| 3073 | +If at least one of `a` and `b` is a `TypedArray` with more than one byte per |
| 3074 | +entry, such as `Uint16Array`, the result will be computed using the platform |
| 3075 | +byte order. |
3072 | 3076 |
|
3073 | 3077 | Use of `crypto.timingSafeEqual` does not guarantee that the *surrounding* code |
3074 | 3078 | is timing-safe. Care should be taken to ensure that the surrounding code does |
|