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

Function encodeUuid

packages/sql/pg/src/PgTypes.ts:901–909  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

899}
900
901const encodeUuid = (value: unknown): Uint8Array => {
902 uuidWords(value)
903 const bytes = new Uint8Array(16)
904 writeInt32(bytes, 0, uuidWord[0])
905 writeInt32(bytes, 4, uuidWord[1])
906 writeInt32(bytes, 8, uuidWord[2])
907 writeInt32(bytes, 12, uuidWord[3])
908 return bytes
909}
910
911// Four int32s are the sixteen bytes, so a uuid parameter needs no array of
912// its own on the way into a frame.

Callers

nothing calls this directly

Calls 2

uuidWordsFunction · 0.85
writeInt32Function · 0.85

Tested by

no test coverage detected