import { fault } from '../canvas-core/values.ts'; /** Bind durable preparation/parse checkpoints to the complete immutable byte source. */ export async function importSourceDigest(bytes:Blob,signal?:AbortSignal):Promise{ if(signal?.aborted)throw fault('import_aborted'); const buffer=await bytes.arrayBuffer();if(signal?.aborted)throw fault('import_aborted'); const digest=await crypto.subtle.digest('SHA-256',buffer);if(signal?.aborted)throw fault('import_aborted'); return [...new Uint8Array(digest)].map(byte=>byte.toString(16).padStart(2,'0')).join(''); }