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

Function decodeUtf8

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

Source from the content-addressed store, hash-verified

135}> {}
136
137const decodeUtf8 = (bytes: Uint8Array) =>
138 Effect.try({
139 try: () => textDecoder.decode(bytes),
140 catch: (cause) =>
141 new EventLogSessionAuthError({
142 reason: "InvalidPayload",
143 message: "Session auth payload contains invalid UTF-8 bytes",
144 cause
145 })
146 })
147
148const assertSigningPublicKeyLength = (signingPublicKey: Uint8Array): Effect.Effect<void, EventLogSessionAuthError> => {
149 if (signingPublicKey.byteLength === Ed25519PublicKeyLength) return Effect.void

Callers 1

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected