()
| 38 | } |
| 39 | |
| 40 | function getDrafts(): Record<string, Draft> { |
| 41 | try { |
| 42 | const raw = localStorage.getItem(DRAFTS_KEY); |
| 43 | if (raw) return JSON.parse(raw); |
| 44 | } catch { |
| 45 | // ignore |
| 46 | } |
| 47 | return {}; |
| 48 | } |
| 49 | |
| 50 | export async function hashCode(code: string): Promise<string> { |
| 51 | const encoded = new TextEncoder().encode(code); |