Beispiel #1
0
        public void EncodeToBuffer()
        {
            var buffer = new char[bytes.Length * 2];

            HexEncoder.Encode(bytes, buffer);

            Assert.Equal(hex, new string(buffer));
        }
Beispiel #2
0
        public void DecodeToBuffer()
        {
            var buffer = new byte[bytes.Length];

            HexEncoder.Decode(hex, buffer);

            Assert.Equal(bytes, buffer);

            HexEncoder.Decode(hex.ToLowerInvariant(), buffer);

            Assert.Equal(bytes, buffer);
        }
Beispiel #3
0
 public void Decode()
 {
     Assert.Equal(bytes, HexEncoder.Decode(hex));
     Assert.Equal(bytes, HexEncoder.Decode(hex.ToLowerInvariant()));
 }
Beispiel #4
0
 public void Encode()
 {
     Assert.Equal(hex, HexEncoder.Encode(bytes));
 }