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

Base85 encoder class. Partially based on: https://github.com/coding-horror/ascii85/tree/master. More...

Static Public Member Functions

static byte[] FromBase85String (string base85string, bool useMarks=false)
 Converts a Base85-string to a byte-array.
 
static string ToBase85String (byte[] bytes, bool useMarks=false)
 Converts a byte-array to a Base85-string.
 
static string ToBase85String (string str, Encoding? encoding=null, bool useMarks=false)
 Converts the value of a string to a Base85-string.
 
static string Base85FromFile (string file, bool useMarks=false)
 Converts a file to a Base85-string.
 
static async Task< string > Base85FromFileAsync (string file, bool useMarks=false)
 Converts a file to a Base85-string asynchronously.
 
static bool FileFromBase85 (string file, string base85string, bool useMarks=false)
 Converts a Base85-string to a file.
 
static async Task< bool > FileFromBase85Async (string file, string base85string, bool useMarks=false)
 Converts a Base85-string to a file asynchronously.
 

Static Public Attributes

static string PrefixMark = "<~"
 Prefix mark that identifies an encoded Base85-string (default: <~).
 
static string SuffixMark = "~>"
 Suffix mark that identifies an encoded Base85-string (default: ~>).
 

Detailed Description

Base85 encoder class. Partially based on: https://github.com/coding-horror/ascii85/tree/master.

Member Function Documentation

◆ Base85FromFile()

static string BogaNet.Encoder.Base85.Base85FromFile ( string file,
bool useMarks = false )
static

Converts a file to a Base85-string.

Parameters
fileFile to convert
useMarksAdd the Prefix and Suffix marks when encoding, and enforce their presence for decoding (default: false).
Returns
File content as converted Base85-string
Exceptions
Exception

◆ Base85FromFileAsync()

static async Task< string > BogaNet.Encoder.Base85.Base85FromFileAsync ( string file,
bool useMarks = false )
static

Converts a file to a Base85-string asynchronously.

Parameters
fileFile to convert
useMarksAdd the Prefix and Suffix marks when encoding, and enforce their presence for decoding (default: false).
Returns
File content as converted Base85-string
Exceptions
Exception

◆ FileFromBase85()

static bool BogaNet.Encoder.Base85.FileFromBase85 ( string file,
string base85string,
bool useMarks = false )
static

Converts a Base85-string to a file.

Parameters
fileFile to write the content of the Base85-string
base85stringData as Base85-string
useMarksAdd the Prefix and Suffix marks when encoding, and enforce their presence for decoding (default: false).
Returns
True if the operation was successful
Exceptions
Exception

◆ FileFromBase85Async()

static async Task< bool > BogaNet.Encoder.Base85.FileFromBase85Async ( string file,
string base85string,
bool useMarks = false )
static

Converts a Base85-string to a file asynchronously.

Parameters
fileFile to write the content of the Base85-string
base85stringData as Base85-string
useMarksAdd the Prefix and Suffix marks when encoding, and enforce their presence for decoding (default: false).
Returns
True if the operation was successful
Exceptions
Exception

◆ FromBase85String()

static byte[] BogaNet.Encoder.Base85.FromBase85String ( string base85string,
bool useMarks = false )
static

Converts a Base85-string to a byte-array.

Parameters
base85stringData as Base85-string
useMarksAdd the Prefix and Suffix marks when encoding, and enforce their presence for decoding (default: false).
Returns
Data as byte-array
Exceptions
ArgumentNullException

◆ ToBase85String() [1/2]

static string BogaNet.Encoder.Base85.ToBase85String ( byte[] bytes,
bool useMarks = false )
static

Converts a byte-array to a Base85-string.

Parameters
bytesData as byte-array
useMarksAdd the Prefix and Suffix marks when encoding, and enforce their presence for decoding (default: false).
Returns
Data as encoded Base85-string
Exceptions
ArgumentNullException

◆ ToBase85String() [2/2]

static string BogaNet.Encoder.Base85.ToBase85String ( string str,
Encoding? encoding = null,
bool useMarks = false )
static

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

Parameters
strInput string
encodingEncoding of the string (optional, default: UTF8)
useMarksAdd the Prefix and Suffix marks when encoding, and enforce their presence for decoding (default: false).
Returns
String value as converted Base85-string
Exceptions
ArgumentNullException

Member Data Documentation

◆ PrefixMark

string BogaNet.Encoder.Base85.PrefixMark = "<~"
static

Prefix mark that identifies an encoded Base85-string (default: <~).

◆ SuffixMark

string BogaNet.Encoder.Base85.SuffixMark = "~>"
static

Suffix mark that identifies an encoded Base85-string (default: ~>).


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