public void Base62Test() { // string test var converter = new Base62Converter(); var testString = "Lorem ipsum dolor sit amet."; byte[] testStringBytes = Encoding.ASCII.GetBytes(testString); string testStringBase62 = converter.ToBase62String(testStringBytes); byte[] finalBytes = converter.FromBase62String(testStringBase62); string finalString = Encoding.ASCII.GetString(finalBytes); Assert.AreEqual(testString, finalString); // byte test var data = new byte[] { 0, 0, 0, 1, 2, 3, 255, 128, 0, 4, 0 }; string dataBase62String = converter.ToBase62String(data); byte[] finalData = converter.FromBase62String(dataBase62String); CollectionAssert.AreEqual(data, finalData); }
public static byte[] FromBase62(string text) { return(Base62Converter.FromBase62String(text)); }