getTransferHash method
Returns the generated transfer hash for a given value.
This method takes a value as input, computes its SHA-256 hash, encodes the hash using base58 encoding with a base of 58, calculates the checksum, converts the checksum to base58, and constructs the transfer hash with the prefix "tr".
Parameters:
- value: The value for which the transfer hash needs to be generated.
Returns: A string representing the generated transfer hash.
Implementation
String getTransferHash(String value) {
var hash256 = getSha256HashToString(value);
hash256 = base58Encode(hash256, BigInt.from(58));
var sumatoria = base58Checksum(hash256);
final bd58 = base58DecimalTo58(sumatoria.toString());
return "tr$hash256$bd58";
}