Skip to main content

@midnight-ntwrk/compact-runtime v0.6.13Readme | API


@midnight-ntwrk/compact-runtime v0.6.13 / persistentHash

Function: persistentHash()

persistentHash(x, y): Uint8Array

The Compact builtin persistent_hash function

This function is a non-circuit-optimised compression function from two 256-bit bytestrings to one 256-bit bytestring. It is guaranteed to persist between upgrades, with the exception of devnet, where this function is provided, but mocked using transientHash. It should be used to derive state data, and not for consistency checks where avoidable.

Parameters

x: Uint8Array

y: Uint8Array

Returns

Uint8Array

Throws

If x or y are not 32 bytes long