MCPcopy Create free account
hub / github.com/pollinations/pollinations / bytesToHex

Function bytesToHex

shared/client-ip.ts:24–28  ·  view source on GitHub ↗
(bytes: ArrayBuffer)

Source from the content-addressed store, hash-verified

22
23/** Lowercase, zero-padded hex encoding of a byte buffer. */
24export function bytesToHex(bytes: ArrayBuffer): string {
25 return Array.from(new Uint8Array(bytes))
26 .map((byte) => byte.toString(16).padStart(2, "0"))
27 .join("");
28}
29
30/** Salted SHA-256 hash of the full IP — irreversible without the salt. */
31export async function hashIp(

Callers 2

createSafetyIdentifierFunction · 0.90
hashIpFunction · 0.85

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected