2 using System.Security.Cryptography;
3 using System.Collections.Generic;
10 /// Representation of RIPEMD-160 hash.
12 public class RIPEMD160 : Hash
15 /// Computes RIPEMD160 hash using managed library
17 private static readonly RIPEMD160Managed _hasher160 = new RIPEMD160Managed();
20 public override int hashSize
25 public RIPEMD160() : base() { }
26 public RIPEMD160(byte[] bytes, int offset = 0) : base(bytes, offset) { }
27 public RIPEMD160(IEnumerable<byte> bytes, int skip = 0) : base(bytes, skip) { }
28 public RIPEMD160(RIPEMD160 h) : base(h) { }
30 public static RIPEMD160 Compute160(IEnumerable<byte> inputBytes)
32 byte[] dataBytes = inputBytes.ToArray();
33 byte[] digest1 = _hasher160.ComputeHash(dataBytes, 0, dataBytes.Length);
35 return new RIPEMD160(digest1);