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

Function checkSize

packages/effect/src/crypto/SecureRandom.ts:125–129  ·  view source on GitHub ↗
(size: number)

Source from the content-addressed store, hash-verified

123}>()("effect/crypto/SecureRandom") {}
124
125const checkSize = (size: number): void => {
126 if (!Number.isSafeInteger(size) || size < 0) {
127 throw new RangeError("size must be a non-negative safe integer")
128 }
129}
130
131const readUint53 = (bytes: Uint8Array): number =>
132 ((bytes[0] & 0x1f) * 2 ** 48) + (bytes[1] * 2 ** 40) + (bytes[2] * 2 ** 32) +

Callers 2

randomBytesCheckedFunction · 0.85
randomBytesUnsafeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected