Class Base64Converter
Converts byte arrays to base64 encoded strings and vice versa.
Declaration
public static class Base64Converter
Methods
Encode(byte[])
Encodes a value using base64 encoding (RFC-4648).
Declaration
public static string Encode(byte[] value)
Returns
System.String
: A base64 encoded string representation of the value
.
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | value | A byte array to encode. |
Encode(byte[], int, int)
Encodes a value using base64 encoding (RFC-4648).
Declaration
public static string Encode(byte[] value, int offset, int length)
Returns
System.String
: A base64 encoded string representation of the value
.
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | value | A byte array to encode. |
System.Int32 | offset | A 0-based offset in the value . |
System.Int32 | length | The number of bytes to encode. |
Decode(string)
Decodes a value using base64 encoding (RFC-4648).
Declaration
public static byte[] Decode(string value)
Returns
System.Byte[]
: A byte array representation of the value
.
Parameters
Type | Name | Description |
---|---|---|
System.String | value | A string encoded in base64. |