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

Function decodeUtf8

packages/effect/src/unstable/eventlog/EventLogSessionAuth.ts:128–137  ·  view source on GitHub ↗
(bytes: Uint8Array)

Source from the content-addressed store, hash-verified

126}
127
128const decodeUtf8 = (bytes: Uint8Array) =>
129 Effect.try({
130 try: () => textDecoder.decode(bytes),
131 catch: (cause) =>
132 new EventLogSessionAuthError({
133 reason: "InvalidPayload",
134 message: "Session auth payload contains invalid UTF-8 bytes",
135 cause
136 })
137 })
138
139const assertSigningPublicKeyLength = (signingPublicKey: Uint8Array): Effect.Effect<void, EventLogSessionAuthError> => {
140 if (signingPublicKey.byteLength === Ed25519PublicKeyLength) return Effect.void

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected