UNPKG

@reclaimprotocol/tls

Version:

TLS 1.2/1.3 for any JavaScript Environment

10 lines (9 loc) 293 B
export function randomBytes(length) { // not the most secure but has to do for an env // without crypto.getRandomValues const bytes = new Uint8Array(length); for (let i = 0; i < length; i++) { bytes[i] = Math.floor(Math.random() * 256) % 256; } return bytes; }