Exemplo n.º 1
0
        public void ToFixedBytes(HashType hashType)
        {
            var length      = HashInfoLookup.Find(hashType).ByteLength;
            var bytes       = Enumerable.Range(0, length).Select(i => (byte)i).ToArray();
            var contentHash = new ContentHash(hashType, bytes);
            var exported    = contentHash.ToFixedBytes();

            Assert.Equal(new FixedBytes(bytes), exported);
        }
Exemplo n.º 2
0
 /// <nodoc/>
 public Hash(ContentHash hash)
 {
     RawHash = new Fingerprint(hash.ToFixedBytes(), hash.Length);
 }