Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Latest commit

 

History

History
32 lines (19 loc) · 719 Bytes

README.md

File metadata and controls

32 lines (19 loc) · 719 Bytes

Denorand

WebAssembly powered random TypedArray generation for Deno, written in Rust.

Usage

deno cache -r https://raw.githubusercontent.com/hazae41/denorand/master/mod.ts
import * as rand from "https://raw.githubusercontent.com/hazae41/denorand/master/mod.ts"

// Generate a random Uint8Array[16]
const bytes = rand.u8(16);
// or u16, u32, u64, i8, i16, i32, i64 

console.log(bytes)

Test

deno cache -r https://raw.githubusercontent.com/hazae41/denorand/master/test.ts
deno run --allow-net https://raw.githubusercontent.com/hazae41/denorand/master/test.ts

Building

  • Install wasm-pack

    cargo install wasm-pack
    
  • Build

    wasm-pack build --target web --release