Packages

đŸ”– Type-safe, unique ids for Gleam

Current section

Files

Jump to
typeid_gleam src typeid.ffi.mjs
Raw

src/typeid.ffi.mjs

import { BitArray } from "./gleam.mjs"
export function strongRandomBytes(n) {
const array = new Uint8Array(n)
globalThis.crypto.getRandomValues(array)
return new BitArray(array)
}