integrity library
SHA-256 integrity verification for Ball modules.
Functions
-
computeIntegrity(
Module module) → String - Compute the integrity hash of a Module's canonical proto binary encoding. Returns the hash in the format "sha256:
-
computeIntegrityFromBytes(
List< int> bytes) → String - Compute the integrity hash of raw bytes.
-
verifyIntegrity(
Module module, String expected) → bool -
Verify that a module matches the expected integrity hash.
Returns true if the hash matches, false otherwise.
If
expectedis empty, always returns true (no verification requested). -
verifyIntegrityFromBytes(
List< int> bytes, String expected) → bool - Verify that raw bytes match the expected integrity hash.