UNPKG

@benev/slate

Version:
8 lines 300 B
export async function hash(text) { const bytes = new TextEncoder().encode(text); const hashed = await crypto.subtle.digest("SHA-256", bytes); return Array.from(new Uint8Array(hashed)) .map(b => b.toString(16).padStart(2, "0")) .join(""); } //# sourceMappingURL=hash.js.map