(bytes)
| 6 | export const SOURCE_LIMIT = 1 << 20; |
| 7 | |
| 8 | export const sha256Hex = async (bytes) => { |
| 9 | const digest = await crypto.subtle.digest('SHA-256', bytes); |
| 10 | return [...new Uint8Array(digest)].map(b => b.toString(16).padStart(2, '0')).join(''); |
| 11 | }; |
| 12 | |
| 13 | export const dirOf = (spec) => { |
| 14 | const i = spec.lastIndexOf('/'); |