-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crypto: fix regression on randomFillSync
Signed-off-by: James M Snell <[email protected]> Fixes: #35722 PR-URL: #35723 Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Beth Griggs <[email protected]>
- Loading branch information
1 parent
c2ceb15
commit 4cbcfae
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
if (!common.hasCrypto) | ||
common.skip('missing crypto'); | ||
|
||
const { randomFillSync } = require('crypto'); | ||
const { notStrictEqual } = require('assert'); | ||
|
||
const ab = new ArrayBuffer(20); | ||
const buf = Buffer.from(ab, 10); | ||
|
||
const before = buf.toString('hex'); | ||
|
||
randomFillSync(buf); | ||
|
||
const after = buf.toString('hex'); | ||
|
||
notStrictEqual(before, after); |