static private void Bug_004_32() { Stream stream = File.OpenRead(CURRENT_PATH + @"\Resources\bug004.txt"); XXHash.State32 state = XXHash.CreateState32(); XXHash.UpdateState32(state, new byte[] { 0x01 }); XXHash.UpdateState32(state, stream); uint result = XXHash.DigestState32(state); // compute the XXH32 hash value. Console.WriteLine(result.ToString("x8")); }
static private void DemoXXHash32() { Stream stream = File.OpenRead(CURRENT_PATH + @"\Resources\letters.txt"); // the data to be hashed XXHash.State32 state = XXHash.CreateState32(); // create and initialize a xxH states instance. // NOTE: // xxHash require a xxH state object for keeping // data, seed, and vectors. XXHash.UpdateState32(state, stream); // puts the file stream into specified xxH state. uint result = XXHash.DigestState32(state); // compute the XXH32 hash value. Console.WriteLine(result.ToString("x4")); }