예제 #1
0
        public void Hash32_Stream_ReturnsExpectedValues(FnvTestVector data)
        {
            using var stream = new MemoryStream(data.Buffer);
            uint result = Fnv1a.Hash32(stream);

            Assert.That(result, Is.EqualTo(data.ExpectedResult32));
        }
예제 #2
0
        private static uint GetFnvHashValue(string word)
        {
            var  encodedWord = Encoding.ASCII.GetBytes(word);
            uint hashResult  = Fnv1a.Hash32(encodedWord);

            return(hashResult);
        }
예제 #3
0
 public void Hash32_Stream_ReturnsExpectedValues(FnvTestVector data)
 {
     using (var stream = new MemoryStream(data.Buffer))
     {
         uint result = Fnv1a.Hash32(stream);
         Assert.AreEqual(data.ExpectedResult32, result);
     }
 }
예제 #4
0
        public void Hash32_ReturnsExpectedValues(FnvTestVector data)
        {
            uint result = Fnv1a.Hash32(data.Buffer);

            Assert.AreEqual(data.ExpectedResult32, result);
        }
예제 #5
0
 public uint ComputePicHash()
 {
     PictureHash = Fnv1a.Hash32(PictureData);
     return(PictureHash);
 }
예제 #6
0
 public override int GetHashCode()
 {
     return((int)Fnv1a.Hash32(Utils.Latin1Encoding.GetBytes(ToString())));
 }
예제 #7
0
        public void Hash32_ReturnsExpectedValues(FnvTestVector data)
        {
            uint result = Fnv1a.Hash32(data.Buffer);

            Assert.That(result, Is.EqualTo(data.ExpectedResult32));
        }
예제 #8
0
 public void Hash32_NullBuffer_ThrowsArgumentNullException()
 {
     Assert.Throws <ArgumentNullException>(() => Fnv1a.Hash32(null));
 }