hashBytes method

Hash hashBytes(
  1. List<int> payload
)

Implementation

Hash hashBytes(List<int> payload) {
  crypto.Hash hash;
  switch (this) {
    case HashType.sha512:
      hash = const DartSha512().hashSync(payload);
      break;
    case HashType.sha1:
      hash = const DartSha1().hashSync(payload);
      break;
    default:
      throw UnimplementedError("Strategy '$name' not implemented.");
  }
  return Hash(this, hash.bytes);
}