sha3 method
Returns Keccak-256 (not the standardized SHA3-256) of the given data.
Implementation
Future<BigInt?> sha3(EthereumData? data) async {
if (data == null) {
throw ArgumentError.notNull('Ethereum::sha3 - data');
}
const method = EthereumRpcMethods.web3Sha3;
final params = <String?>[data.asString];
final dynamic res = await _client.rpcClient.request(method, params);
if (res != null && res.containsKey(EthereumConstants.ethResultKey)) {
return EthereumUtilities.safeParse(res[EthereumConstants.ethResultKey]);
}
_client.processError(method, res);
return null;
}