These docs are for v1.3.0. Click to read the latest docs for v1.6.

assert_sha512

Tests if the sha512 hash generated from data matches the provided checksum.

Tests if the sha512 hash generated from data matches the provided checksum. This method is optimized to a NO-OP when in fast evaluation mode.

Parameters

  • data - Data you want to hash

  • length - Data length

  • hash - checksum512* hash to compare to

Precondition

assert512 hash of data equals provided hash parameter.

Post Condition

Executes next statement. If was not true, hard return.

Example

checksum hash;
char data;
uint32_t length;
assert_sha512( data, length, hash )
//If the sha512 hash generated from data does not equal provided hash, anything below will never fire.
eosio::print("sha512 hash generated from data equals provided hash");