App.Security.PasswordHash.Equals C# (CSharp) Method

Equals() private static method

Compares two byte arrays in length-constant time. This comparison method is used so that password hashes cannot be extracted from on-line systems using a timing attack and then attacked off-line.
private static Equals ( byte a, byte b ) : bool
a byte The first byte array.
b byte The second byte array.
return bool
        private static bool Equals(byte[] a, byte[] b)
        {
            var diff = (uint)a.Length ^ (uint)b.Length;

            for (var i = 0; i < a.Length && i < b.Length; i++)
            {
                diff |= (uint)(a[i] ^ b[i]);
            }

            return diff == 0;
        }