Ejemplo n.º 1
0
 /// <summary> Compares the hash </summary>
 public override int CompareTo(PasswordHash other)
 {
     if (((object)other) == null)
     {
         return(1);
     }
     return(BinaryComparer.Compare(_hash.ToArray(), other._hash.ToArray()));
 }
Ejemplo n.º 2
0
 /// <summary> Returns true if the two Salts are using the same data </summary>
 public override bool Equals(Salt other)
 {
     return(((object)other) != null && this.Length == other.Length &&
            BinaryComparer.Equals(_salt, other._salt));
 }
Ejemplo n.º 3
0
 /// <summary> Returns a hash code the instance of the object </summary>
 int IEqualityComparer <byte[]> .GetHashCode(byte[] bytes)
 {
     return(BinaryComparer.GetHashCode(bytes));
 }
Ejemplo n.º 4
0
 /// <summary> Returns true if the two objects are the same instance </summary>
 bool IEqualityComparer <byte[]> .Equals(byte[] x, byte[] y)
 {
     return(0 == BinaryComparer.Compare(x, y));
 }
Ejemplo n.º 5
0
 /// <summary> Compares the contents of the byte arrays and returns the result. </summary>
 int IComparer <byte[]> .Compare(byte[] x, byte[] y)
 {
     return(BinaryComparer.Compare(x, y));
 }
Ejemplo n.º 6
0
 /// <summary> Compares the hash codes and returns the result </summary>
 public override int CompareTo(Hash other)
 {
     return(other == null ? 1 : BinaryComparer.Compare(_hashCode, other._hashCode));
 }