Ejemplo n.º 1
0
 // Returns a copy of this MD object.
 public object Clone()
 {
     Md4Slim md4 = new Md4Slim();
     //    This constructor is here to implement cloneability of this class.
     application = new uint[md4.application.Length];
     JSArrayEx.Copy(md4.application, 0, application, 0, application.Length);
     buffer = new byte[md4.buffer.Length];
     JSArrayEx.Copy(md4.buffer, 0, buffer, 0, buffer.Length);
     count = md4.count;
     return md4;
 }
Ejemplo n.º 2
0
 // Bugfixed, now works prima (RST).
 public static int Com_BlockChecksum(byte[] buffer, int length)
 {
     int val;
     Md4Slim md4 = new Md4Slim();
     md4.Update(buffer, 0, length);
     byte[] data = md4.GetDigest();
     MemoryStream b = new MemoryStream(data);
     val = SE.ReadInt32(b) ^ SE.ReadInt32(b) ^ SE.ReadInt32(b) ^ SE.ReadInt32(b);
     return val;
 }