public void Encode(string input, string output) { var buffer = System.Text.Encoding.ASCII.GetBytes(input); var encoded = Base45Encoding.Encode(buffer); Assert.Equal(output, encoded); }
public void Boundary45Equal() { var buffer = new byte[] { 45 }; var encoded = Base45Encoding.Encode(buffer); Assert.Equal(2, encoded.Length); var decoded = Base45Encoding.Decode(encoded); Assert.Equal(buffer, decoded); }
private static void Main(string[] args) { var buffer = new byte[Convert.ToInt64(args[0])]; new Random().NextBytes(buffer); //Console.WriteLine(BitConverter.ToString(buffer)); var encoded = Base45Encoding.Encode(buffer); var s = new Stopwatch(); s.Start(); var decoded = Base45Encoding.Decode(encoded); s.Stop(); Console.WriteLine(s.ElapsedMilliseconds); }
public void EncodeNullGoBang() { Assert.Throws <ArgumentNullException>(() => Base45Encoding.Encode(null)); }
public void EncodeArrayOfZeros(int len, string output) { var encoded = Base45Encoding.Encode(new byte[len]); Assert.Equal(output, encoded); }