Verify model integrity by checking SHA256 hash
Name of the model file
Model data as ArrayBuffer
Promise - True if hash matches, false otherwise
const isValid = await verifyModelIntegrity('u2net.onnx', modelData);if (!isValid) { console.warn('Model integrity check failed');} Copy
const isValid = await verifyModelIntegrity('u2net.onnx', modelData);if (!isValid) { console.warn('Model integrity check failed');}
Verify model integrity by checking SHA256 hash