Example #1
0
 public Hasher Update(byte[] buf, int len)
 {
     if (len < 0 || len >= buf.Length)
     {
         throw new IndexOutOfRangeException();
     }
     Bindings.rhash_update(ptr, buf, len);
     return(this);
 }
Example #2
0
        public Hasher UpdateFile(string filename)
        {
            Stream file = new FileStream(filename, FileMode.Open);

            byte[] buf = new byte[8192];
            int    len = file.Read(buf, 0, 8192);

            while (len > 0)
            {
                Bindings.rhash_update(ptr, buf, len);
                len = file.Read(buf, 0, 8192);
            }
            file.Close();
            return(this);
        }
Example #3
0
 public Hasher Update(byte[] buf)
 {
     Bindings.rhash_update(ptr, buf, buf.Length);
     return(this);
 }