swc/crates/swc_bundler/tests/.cache/untrusted/35fdd53761b52373b1b3937056a38939fb407824.ts
2021-11-09 20:42:49 +09:00

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;
}