Skip to content

Base32 encoding and decoding in .NET

License

Notifications You must be signed in to change notification settings

marthijn/Sidio.Text.Base32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sidio.Text.Base32

A simple .NET package that converts a byte array to a Base32 string and vice versa. Because the latest framework features are used, .NET 8.0 or higher is required.

build NuGet Version Coverage Status

Usage

Encode

var myString = "foobar";
var bytes = Encoding.UTF8.GetBytes(myString);
var base32 = Base32.Encode(bytes);

Decode

var base32 = "MZXW6YTBOI======";
var bytes = Base32.Decode(base32);
var myString = Encoding.UTF8.GetString(bytes);

Encode hex

var myString = "foobar";
var bytes = Encoding.UTF8.GetBytes(myString);
var base32 = Base32.EncodeHex(bytes);

Decode hex

var base32 = "CPNMUOJ1E8======";
var bytes = Base32.DecodeHex(base32);
var myString = Encoding.UTF8.GetString(bytes);

References