Crc32.HashFinal C# (CSharp) Method

HashFinal() protected method

protected HashFinal ( ) : byte[]
return byte[]
    protected override byte[] HashFinal()
    {
        byte[] hashBuffer = UInt32ToBigEndianBytes(~hash);
        this.HashValue = hashBuffer;
        return hashBuffer;
    }

Usage Example

Beispiel #1
0
        public static int GetCrc32(byte[] bytes, int offset, int length)
        {
            if (bytes == null)
            {
                Warning("Bytes is invalid.");
            }
            if (offset < 0 || length < 0 || offset + length > bytes.Length)
            {
                Warning("Offset or length is invalid.");
            }
            s_Algorithm.HashCore(bytes, offset, length);
            int result = (int)s_Algorithm.HashFinal();

            s_Algorithm.Initialize();
            return(result);
        }