BogaNet 1.4.0
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
BogaNet.Encoder.Base16 Class Reference

Base16 (aka Hex) encoder class. More...

Static Public Member Functions

static byte[] FromBase16String (string base16string)
 Converts a Base16-string to a byte-array.
 
static string ToBase16String (byte[] bytes, bool addPrefix=false)
 Converts a byte-array to a Base16-string.
 
static string ToBase16String< T > (T number, bool addPrefix=false, bool useFullLength=false)
 Converts the value of a Number to a Base16-string.
 
static string ToBase16String (string str, bool addPrefix=false, Encoding? encoding=null)
 Converts the value of a string to a Base16-string.
 
static string Base16FromFile (string file)
 Converts a file to a Base16-string.
 
static async Task< string > Base16FromFileAsync (string file)
 Converts a file to a Base16-string asynchronously.
 
static bool FileFromBase16 (string file, string base16string)
 Converts a Base16-string to a file.
 
static async Task< bool > FileFromBase16Async (string file, string base16string)
 Converts a Base16-string to a file asynchronously.
 

Detailed Description

Base16 (aka Hex) encoder class.

Member Function Documentation

◆ Base16FromFile()

static string BogaNet.Encoder.Base16.Base16FromFile ( string file)
static

Converts a file to a Base16-string.

Parameters
fileFile to convert
Returns
File content as converted Base16-string
Exceptions
Exception

◆ Base16FromFileAsync()

static async Task< string > BogaNet.Encoder.Base16.Base16FromFileAsync ( string file)
static

Converts a file to a Base16-string asynchronously.

Parameters
fileFile to convert
Returns
File content as converted Base16-string
Exceptions
Exception

◆ FileFromBase16()

static bool BogaNet.Encoder.Base16.FileFromBase16 ( string file,
string base16string )
static

Converts a Base16-string to a file.

Parameters
fileFile to write the content of the Base16-string
base16stringData as Base16-string
Returns
True if the operation was successful
Exceptions
Exception

◆ FileFromBase16Async()

static async Task< bool > BogaNet.Encoder.Base16.FileFromBase16Async ( string file,
string base16string )
static

Converts a Base16-string to a file asynchronously.

Parameters
fileFile to write the content of the Base16-string
base16stringData as Base16-string
Returns
True if the operation was successful
Exceptions
Exception

◆ FromBase16String()

static byte[] BogaNet.Encoder.Base16.FromBase16String ( string base16string)
static

Converts a Base16-string to a byte-array.

Parameters
base16stringData as Base16-string
Returns
Data as byte-array
Exceptions
ArgumentNullException

◆ ToBase16String() [1/2]

static string BogaNet.Encoder.Base16.ToBase16String ( byte[] bytes,
bool addPrefix = false )
static

Converts a byte-array to a Base16-string.

Parameters
bytesData as byte-array
addPrefixAdd "0x"-as prefix (optional, default: false)
Returns
Data as encoded Base16-string
Exceptions
ArgumentNullException

◆ ToBase16String() [2/2]

static string BogaNet.Encoder.Base16.ToBase16String ( string str,
bool addPrefix = false,
Encoding? encoding = null )
static

Converts the value of a string to a Base16-string.

Parameters
strInput string
addPrefixAdd "0x"-as prefix (optional, default: false)
encodingEncoding of the string (optional, default: UTF8)
Returns
String value as converted Base16-string
Exceptions
ArgumentNullException

◆ ToBase16String< T >()

static string BogaNet.Encoder.Base16.ToBase16String< T > ( T number,
bool addPrefix = false,
bool useFullLength = false )
static

Converts the value of a Number to a Base16-string.

Parameters
numberGiven value
addPrefixAdd "0x"-as prefix (optional, default: false)
useFullLengthUse the full length of the Number type (optional, default: false)
Returns
Number as converted Base16-string
Exceptions
ArgumentNullException
Type Constraints
T :INumber<T> 

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