Visual Basic (Declaration) | |
---|---|
Public Overloads Shared Function DecodeBytes( _ ByVal data As String _ ) As Byte() |
Parameters
- data
Library/Library.Test/TestSafe64Encoding.cs
C# | Copy Code |
---|---|
//char count must by multiple of 4 for the compare to work string encoded = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"; byte[] data = Safe64Encoding.DecodeBytes(encoded); Assert.AreEqual(encoded, Safe64Encoding.EncodeBytes(data)); data = AsciiEncoder.DecodeBytes(encoded); Assert.AreEqual(encoded, AsciiEncoder.EncodeBytes(data)); data = AsciiEncoder.DecodeBytes(Encoding.ASCII.GetBytes(encoded)); Assert.AreEqual(encoded, AsciiEncoder.EncodeBytes(data)); |
VB.NET | Copy Code |
---|---|
'char count must by multiple of 4 for the compare to work Dim encoded As String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_" Dim data As Byte() = Safe64Encoding.DecodeBytes(encoded) Assert.AreEqual(encoded, Safe64Encoding.EncodeBytes(data)) data = AsciiEncoder.DecodeBytes(encoded) Assert.AreEqual(encoded, AsciiEncoder.EncodeBytes(data)) data = AsciiEncoder.DecodeBytes(Encoding.ASCII.GetBytes(encoded)) Assert.AreEqual(encoded, AsciiEncoder.EncodeBytes(data)) |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
AsciiEncoder ClassAsciiEncoder Members
Overload List