SHA256
10 lines
351 B
JavaScript
10 lines
351 B
JavaScript
// Stub placeholder for noble-hashes utils module
|
|
export function toHex(bytes) {
|
|
return Array.from(bytes).map(b => b.toString(16).padStart(2, "0")).join("");
|
|
}
|
|
export function fromHex(hex) {
|
|
const bytes = new Uint8Array(hex.length / 2);
|
|
for (let i = 0; i < hex.length; i += 2) bytes[i / 2] = parseInt(hex.slice(i, i + 2), 16);
|
|
return bytes;
|
|
}
|