4 using System.Collections.Generic;
6 using System.Security.Cryptography;
11 /// Representation of SHA-256 hash
13 public class SHA1 : Hash
16 /// Computes RIPEMD160 hash using managed library
18 private static readonly SHA1Managed _hasher1 = new SHA1Managed();
21 public override int hashSize
26 public SHA1() : base() { }
27 public SHA1(byte[] bytes, int offset = 0) : base(bytes, offset) { }
28 public SHA1(IEnumerable<byte> bytes, int skip = 0) : base(bytes, skip) { }
29 public SHA1(SHA1 h) : base(h) { }
32 public static SHA1 Compute1(IEnumerable<byte> inputBytes)
34 byte[] dataBytes = inputBytes.ToArray();
35 byte[] digest1 = _hasher1.ComputeHash(dataBytes, 0, dataBytes.Length);
37 return new SHA1(digest1);