mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 12:41:54 +03:00
bbaf619f63
swc_bundler: - [x] Fix wrapped esms. (denoland/deno#9307) - [x] Make test secure.
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;
|
|
}
|