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

Function xor

packages/sql/pg/src/PgAuth.ts:60–66  ·  view source on GitHub ↗
(left: Uint8Array, right: Uint8Array)

Source from the content-addressed store, hash-verified

58 bytesOf(createHmac("sha256", key).update(data).digest())
59
60const xor = (left: Uint8Array, right: Uint8Array): Uint8Array => {
61 const result = new Uint8Array(left.length)
62 for (let i = 0; i < left.length; i++) {
63 result[i] = left[i] ^ right[i]
64 }
65 return result
66}
67
68const toBase64 = (bytes: Uint8Array): string => Base64.encode(bytes)
69

Callers 2

scramContinueUnsafeFunction · 0.85
Boolean.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected