BaseNEncodings.Net is a general base16, base32, base64 encodings library for .NET 2.0+, which is according to RFC 4648.
The project java-base-n-encodings was migrated from BaseNEncodings.Net.
The repository had been transfered from wallf.
- Represents a general Base-N data encoding as an abstract class.
- Implements standard encodings of RFC 4648.
- Base 64 Encoding
- Base 64 Encoding with URL and Filename Safe Alphabet
- Base 32 Encoding
- Base 32 Encoding with Extended Hex Alphabet
- Base 16 Encoding
- Supports custom alphabet and padding for your Base-N Encoding.
- Does not contain unsafe code.
- Includes the simple and informal benchmark subprojects.
-
Adds a reference of the assembly in you project.
PM> Install-Package WallF.BaseNEncodings
-
Using the WallF.BaseNEncodings namespace.
using WallF.BaseNEncodings;
-
Gets instance of encodings.
// standard encoding(RFC 4648) BaseEncoding encoding = BaseEncoding.Base64; // custom encoding char[] alphabet = {...}; char padding = '.'; BaseEncoding encoding = new Base64Encoding(alphabet, padding, "custom encoding");
-
Converts by the methods To/FromBaseString, Encode, Decode.
BaseEncoding encoding = ...; byte[] bin = new byte[1024]; string baseString = encoding.ToBaseString(bin); byte[] data = encoding.FromBaseString(baseString); // bin and data contains the same elements