(value: string)
| 5 | } |
| 6 | |
| 7 | export function base64Decode(value: string) { |
| 8 | const binary = atob(value.replace(/-/g, "+").replace(/_/g, "/")) |
| 9 | const bytes = Uint8Array.from(binary, (c) => c.charCodeAt(0)) |
| 10 | return new TextDecoder().decode(bytes) |
| 11 | } |
| 12 | |
| 13 | export async function hash(content: string, algorithm = "SHA-256"): Promise<string> { |
| 14 | const encoder = new TextEncoder() |