mirror of
https://github.com/swc-project/swc.git
synced 2024-12-01 09:52:57 +03:00
11 lines
279 B
TypeScript
11 lines
279 B
TypeScript
// Loaded from https://raw.githubusercontent.com/aricart/tweetnacl-deno/import-type-fixes/src/random.ts
|
|
|
|
|
|
import { ByteArray } from './array.ts';
|
|
|
|
export function randomBytes(n: number): ByteArray {
|
|
let b = ByteArray(n);
|
|
window.crypto.getRandomValues(b);
|
|
return b;
|
|
}
|