Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ext/crypto): adjust getRandomValues types #14714

Merged
merged 7 commits into from
Jun 2, 2022
Next Next commit
fix: add BigUint64Array to crypto getRandomValues
  • Loading branch information
mrkldshv committed May 25, 2022
commit 4539aa95d3262a26d4e4f82b4cfa5d921cfa3824
6 changes: 6 additions & 0 deletions cli/tests/unit/get_random_values_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ Deno.test(function getRandomValuesUint32Array() {
assertNotEquals(arr, new Uint32Array(8));
});

Deno.test(function getRandomValuesBigUint64Array() {
const arr = new BigUint64Array(8);
crypto.getRandomValues(arr);
assertNotEquals(arr, new BigUint64Array(8));
});

Deno.test(function getRandomValuesReturnValue() {
const arr = new Uint32Array(8);
const rtn = crypto.getRandomValues(arr);
Expand Down
1 change: 1 addition & 0 deletions ext/crypto/lib.deno_crypto.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ declare interface Crypto {
| Uint16Array
| Uint32Array
| Uint8ClampedArray
| BigUint64Array
mrkldshv marked this conversation as resolved.
Show resolved Hide resolved
| Float32Array
| Float64Array
| DataView
Expand Down