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

Function uuidString

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

Source from the content-addressed store, hash-verified

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
20const assertDies = <A>(exit: Exit.Exit<A>) => assert.isTrue(Exit.isFailure(exit) && Cause.hasDies(exit.cause))

Callers 1

Calls 2

hexFunction · 0.70
replaceMethod · 0.45

Tested by

no test coverage detected