Options
All
  • Public
  • Public/Protected
  • All
Menu

Currently browser only, a window.crypto backed IRandom implementation. Random values are buffered to minimize overhead. Buffer size is configurable via ctor.

remarks

Internally uses randomBytes to source values, which falls back to using SYSTEM iff window.crypto is not available.

Hierarchy

Implements

  • IBuffered<Uint8Array>
  • ICopy<Crypto>

Index

Constructors

constructor

  • new Crypto(size?: number): Crypto

Properties

buffer

buffer: Uint8Array

Protected i

i: number

Protected u32

u32: Uint32Array

Methods

bytes

  • bytes(): Uint8Array

copy

float

  • float(norm?: number): number

int

  • int(): number

minmax

  • minmax(min: number, max: number): number

norm

  • norm(norm?: number): number

Generated using TypeDoc