public byte[] HashFinal () { byte[] hash = new byte[20]; ProcessFinalBlock (_ProcessingBuffer, 0, _ProcessingBufferCount); for (int i=0; i<5; i++) { for (int j=0; j<4; j++) { hash [i*4+j] = (byte)(_H[i] >> (8*(3-j))); } } return hash; }
public static byte[] ComputeHash(byte[] bytes) { var sha = new SHA1Internal(); sha.HashCore(bytes, 0, bytes.Length); return(sha.HashFinal()); }