Table of Contents

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

base64Encoded string

The 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

hexEncoded string

The hex-encoded string to convert.

Returns

List<byte>

ToBase64(List<byte>)

Converts from a list of bytes to a string Base64 representation.

public static string ToBase64(List<byte> byteList)

Parameters

byteList List<byte>

The byte list to convert.

Returns

string

ToHex(List<byte>)

Converts a list of bytes to a hexadecimal string representation.

public static string ToHex(List<byte> byteList)

Parameters

byteList List<byte>

The byte list to convert.

Returns

string