(code: string)
| 48 | } |
| 49 | |
| 50 | export async function hashCode(code: string): Promise<string> { |
| 51 | const encoded = new TextEncoder().encode(code); |
| 52 | const buffer = await crypto.subtle.digest("SHA-256", encoded); |
| 53 | |
| 54 | return Array.from(new Uint8Array(buffer), (b) => b.toString(16).padStart(2, "0")).join(""); |
| 55 | } |
| 56 | |
| 57 | export function saveDraft( |
| 58 | chapterId: string, |
nothing calls this directly
no outgoing calls
no test coverage detected