All Products
Search
Document Center

Blockchain as a Service:digest Function

Last Updated:Jan 03, 2020

digest instead of sha256() is used to calculate digests.

Function prototype

  1. digest(bytes data, int type) returns(bool result, bytes32 data);

Request parameters

Parameter Required Type Description
data Yes bytes The data of which the digest needs to be calculated.
type Yes int The method type which can be sha256 or sm3_256.

Response parameters

Parameter Required Type Description
result Yes bool The value returned by the method, which can be true or false.
data Yes bytes32 The returned digest.