MCPcopy Create free account
hub / github.com/Effect-TS/effect / getRandomValues

Function getRandomValues

packages/platform/browser/test/BrowserCrypto.test.ts:11–18  ·  view source on GitHub ↗
(array: T)

Source from the content-addressed store, hash-verified

9const uuidV7Regex = /^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
10
11const getRandomValues = <T extends ArrayBufferView | null>(array: T): T => {
12 if (array instanceof Uint8Array) {
13 for (let i = 0; i < array.length; i++) {
14 array[i] = i & 0xff
15 }
16 }
17 return array
18}
19
20describe("BrowserCrypto", () => {
21 it.effect("generates random bytes at and above the getRandomValues limit", () => {

Callers

nothing calls this directly

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected