Class Utils
- Namespace
- SunamoShared.Crypting
- Assembly
- SunamoShared.dll
Provides utility methods for converting between byte arrays and hex or Base64 string representations.
public class Utils
- Inheritance
-
Utils
- Inherited Members
- Extension Methods
Methods
FromBase64(string)
Converts from a string Base64 representation to an array of bytes. Throws if the string is not a valid Base64 format.
public static byte[] FromBase64(string base64Encoded)
Parameters
base64EncodedstringThe Base64-encoded string to convert.
Returns
- byte[]
FromHex(string)
Converts from a string hex representation to a list of bytes. Throws if the string is not a valid hex format.
public static List<byte> FromHex(string hexEncoded)
Parameters
hexEncodedstringThe hex-encoded string to convert.
Returns
ToBase64(List<byte>)
Converts from a list of bytes to a string Base64 representation.
public static string ToBase64(List<byte> byteList)
Parameters
Returns
ToHex(List<byte>)
Converts a list of bytes to a hexadecimal string representation.
public static string ToHex(List<byte> byteList)