Exemplo n.º 1
0
        public static uint MakeForString(string s)
        {
            var inst = new AdlerChecksum();

            if (!inst.TryMakeForString(s))
            {
                throw new InvalidOperationException(string.Format(Resources.AdlerChecksum_MakeForString_Invalid_string___0___for_checksum, s ?? @"(null)"));
            }
            return(inst.ChecksumValue);
        }
Exemplo n.º 2
0
        public static uint MakeForBuff(byte[] bytesBuff)
        {
            var inst = new AdlerChecksum();

            if (!inst.TryMakeForBuff(bytesBuff))
            {
                throw new InvalidOperationException(Resources.AdlerChecksum_MakeForBuff_Invalid_byte_buffer_for_checksum);
            }
            return(inst.ChecksumValue);
        }
Exemplo n.º 3
0
 public bool Equals(AdlerChecksum obj)
 {
     if (ReferenceEquals(null, obj))
     {
         return(false);
     }
     if (ReferenceEquals(this, obj))
     {
         return(true);
     }
     return(obj.ChecksumValue == ChecksumValue);
 }
Exemplo n.º 4
0
        public static uint MakeForFile(string sPath)
        {
            var inst = new AdlerChecksum();

            if (!inst.TryMakeForFile(sPath))
            {
                throw new IOException(
                          string.Format(
                              Resources.AdlerChecksum_MakeForFile_Failure_attempting_to_calculate_a_checksum_for_the_file__0__,
                              sPath));
            }
            return(inst.ChecksumValue);
        }
Exemplo n.º 5
0
 public bool Equals(AdlerChecksum obj)
 {
     if (ReferenceEquals(null, obj)) return false;
     if (ReferenceEquals(this, obj)) return true;
     return obj.ChecksumValue == ChecksumValue;
 }
Exemplo n.º 6
0
 public static uint MakeForString(string s)
 {
     var inst = new AdlerChecksum();
     if (!inst.TryMakeForString(s))
         throw new InvalidOperationException(string.Format(Resources.AdlerChecksum_MakeForString_Invalid_string___0___for_checksum, s ?? "(null)")); // Not L10N
     return inst.ChecksumValue;
 }
Exemplo n.º 7
0
 public static uint MakeForFile(string sPath)
 {
     var inst = new AdlerChecksum();
     if (!inst.TryMakeForFile(sPath))
         throw new IOException(
             string.Format(
                 Resources.AdlerChecksum_MakeForFile_Failure_attempting_to_calculate_a_checksum_for_the_file__0__,
                 sPath));
     return inst.ChecksumValue;
 }
Exemplo n.º 8
0
 public static uint MakeForBuff(byte[] bytesBuff)
 {
     var inst = new AdlerChecksum();
     if (!inst.TryMakeForBuff(bytesBuff))
         throw new InvalidOperationException(Resources.AdlerChecksum_MakeForBuff_Invalid_byte_buffer_for_checksum);
     return inst.ChecksumValue;
 }