예제 #1
0
        public async Task HashExternal64Async()
        {
            long hash;

            using (HashedStream hs = new HashedStream(GetFileStream()))
            {
                hash = await SpookyHasher.SpookyHash64Async(hs);

                Assert.Equal(hash, hs.ReadHash64);
            }
            using (FileStream fs = GetFileStream())
            {
                Assert.Equal((ulong)hash, await fs.SpookyHash64Async(0xDEADBEEFDEADBEEF));
            }
            using (FileStream fs = GetFileStream())
            {
                Assert.Equal(hash, unchecked (await fs.SpookyHash64Async((long)0xDEADBEEFDEADBEEF)));
            }
        }
예제 #2
0
 public void NullStreamU32()
 {
     Assert.Throws <ArgumentNullException>("stream", () => SpookyHasher.SpookyHash32(null, 1U));
 }