ripemd160 function

Uint8List ripemd160(
  1. dynamic a, {
  2. bool padded = false,
})

Creates RIPEMD160 hash of the input.

Implementation

Uint8List ripemd160(dynamic a, {bool padded: false}) {
  a = bytes.toBuffer(a);
  Digest rmd160 = new Digest('RIPEMD-160');
  var hash = rmd160.process(a);
  if (padded) {
    return bytes.setLength(hash, 32);
  } else {
    return hash;
  }
}