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)); }
private static uint GetFnvHashValue(string word) { var encodedWord = Encoding.ASCII.GetBytes(word); uint hashResult = Fnv1a.Hash32(encodedWord); return(hashResult); }
public void Hash32_Stream_ReturnsExpectedValues(FnvTestVector data) { using (var stream = new MemoryStream(data.Buffer)) { uint result = Fnv1a.Hash32(stream); Assert.AreEqual(data.ExpectedResult32, result); } }
public void Hash32_ReturnsExpectedValues(FnvTestVector data) { uint result = Fnv1a.Hash32(data.Buffer); Assert.AreEqual(data.ExpectedResult32, result); }
public uint ComputePicHash() { PictureHash = Fnv1a.Hash32(PictureData); return(PictureHash); }
public override int GetHashCode() { return((int)Fnv1a.Hash32(Utils.Latin1Encoding.GetBytes(ToString()))); }
public void Hash32_ReturnsExpectedValues(FnvTestVector data) { uint result = Fnv1a.Hash32(data.Buffer); Assert.That(result, Is.EqualTo(data.ExpectedResult32)); }
public void Hash32_NullBuffer_ThrowsArgumentNullException() { Assert.Throws <ArgumentNullException>(() => Fnv1a.Hash32(null)); }