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

Function hex

packages/effect/test/crypto/SecureRandom.test.ts:16–16  ·  view source on GitHub ↗
(bytes: Uint8Array)

Source from the content-addressed store, hash-verified

14const counting = SecureRandom.make((size) => Uint8Array.from({ length: size }, (_, i) => i & 0xff))
15
16const hex = (bytes: Uint8Array) => Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("")
17const uuidString = (bytes: Uint8Array) => hex(bytes).replace(/^(.{8})(.{4})(.{4})(.{4})/, "$1-$2-$3-$4-")
18const isStrictlyIncreasing = (ids: ReadonlyArray<string>) => ids.every((id, i) => i === 0 || ids[i - 1] < id)
19

Callers 1

uuidStringFunction · 0.70

Calls 3

fromMethod · 0.80
toStringMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected