예제 #1
0
 public Property TestRoundTrip()
 {
     return(Prop.ForAll(
                Arb.From <byte[]>(),
                bytes =>
     {
         var base58 = Base58.ConvertTo(bytes);
         // Oversize the buffer
         var result = new byte[bytes.Length + 8];
         var count = Base58.ConvertFrom(base58, result);
         // trim to decoded size
         result = result.AsSpan().Slice(0, count).ToArray();
         Assert.Equal(bytes.Length, count);
         Assert.Equal(bytes, result);
     }));
 }