public void TestEd25519Seed(string base58) { var bytes = new byte[19]; Base58Check.ConvertFrom(base58, bytes); Assert.Equal(base58, Base58Check.ConvertTo(bytes)); }
public void TestSecp256k1Seed(string base58) { var bytes = new byte[17]; var count = Base58Check.ConvertFrom(base58, bytes); Assert.Equal(count, bytes.Length); Assert.Equal(base58, Base58Check.ConvertTo(bytes)); }
public void TestAccount(string base58) { var bytes = new byte[21]; var count = Base58Check.ConvertFrom(base58, bytes); Assert.Equal(count, bytes.Length); Assert.Equal(base58, Base58Check.ConvertTo(bytes)); }
public Property TestRoundTrip() { return(Prop.ForAll( Arb.From <byte[]>(), bytes => { var base58 = Base58Check.ConvertTo(bytes); // Oversize the buffer var result = new byte[bytes.Length + 8]; var count = Base58Check.ConvertFrom(base58, result); // trim to decoded size result = result.AsSpan().Slice(0, count).ToArray(); Assert.Equal(bytes.Length, count); Assert.Equal(bytes, result); })); }