NanoByte.Common  2.9.0
NanoByte.Common.EncodingUtils Class Reference

Helper methods for hashing and Base16/32/64 encoding/decoding. More...

Static Public Member Functions

static string Hash (this string value, HashAlgorithm algorithm)
 Computes the hash value of a string encoded as UTF-8. More...
 
static string Base64Utf8Encode (this string value)
 Encodes a string as UTF-8 in base64. More...
 
static string Base64Utf8Decode (this string value)
 Decodes a UTF-8 in base64 string. More...
 
static string Base32Encode (this byte[] data)
 Encodes a byte array in base32 without padding. More...
 
static string Base16Encode (this byte[] data)
 Encodes a byte array in base16 (hexadecimal). More...
 
static byte[] Base16Decode (this string encoded)
 Decodes a base16 (hexadecimal) to a byte array. More...
 

Detailed Description

Helper methods for hashing and Base16/32/64 encoding/decoding.

Member Function Documentation

◆ Base16Decode()

static byte [] NanoByte.Common.EncodingUtils.Base16Decode ( this string  encoded)
inlinestatic

Decodes a base16 (hexadecimal) to a byte array.

◆ Base16Encode()

static string NanoByte.Common.EncodingUtils.Base16Encode ( this byte[]  data)
inlinestatic

Encodes a byte array in base16 (hexadecimal).

◆ Base32Encode()

static string NanoByte.Common.EncodingUtils.Base32Encode ( this byte[]  data)
inlinestatic

Encodes a byte array in base32 without padding.

◆ Base64Utf8Decode()

static string NanoByte.Common.EncodingUtils.Base64Utf8Decode ( this string  value)
inlinestatic

Decodes a UTF-8 in base64 string.

Exceptions
FormatExceptionvalue is not a valid base 64 string.

◆ Base64Utf8Encode()

static string NanoByte.Common.EncodingUtils.Base64Utf8Encode ( this string  value)
inlinestatic

Encodes a string as UTF-8 in base64.

◆ Hash()

static string NanoByte.Common.EncodingUtils.Hash ( this string  value,
HashAlgorithm  algorithm 
)
inlinestatic

Computes the hash value of a string encoded as UTF-8.

Parameters
valueThe string to hash.
algorithmThe hashing algorithm to use.
Returns
A hexadecimal string representation of the hash value.

The documentation for this class was generated from the following file: