getDigestFromRawData
getDigestFromRawData(
blob):unknown
Computes a Blake2 H256 hash digest from the provided raw data (blob).
This function verifies if the input blob is serialized before hashing it.
Parameters
Section titled “Parameters”• blob: string
The raw data input for which the digest needs to be calculated. This should be a serialized string.
Returns
Section titled “Returns”unknown
A promise that resolves to the computed digest of the blob, represented as a hexadecimal string.
Throws
Section titled “Throws”If the blob is not serialized.
Example
Section titled “Example”const rawData = '{"key": "value"}';try { const digest = await getDigestFromRawData(rawData); console.log(`Computed Digest: ${digest}`);} catch (error) { console.error(error.message);}