computeIntegrity
Computes the integrity of data with algorithm.
Computes the integrity of data with algorithm.
This is the write side of integrity: use it when publishing a bundle to produce the string a source or updater later verifies against.
function computeIntegrity(algorithm: IntegrityAlgorithm, data: Buffer): Integrity;Parameters
Prop
Type
Returns
Integrity — The computed integrity
Examples
import { computeIntegrity } from '@wvb/node';
const integrity = computeIntegrity('sha256', data).serialize();
// "sha256:n4bQgYhMfWWaL+qgxVrQFaO/TxsrC4Is0V1sFbDwCgg="