Skip to content
BaseNEncodings.Net is an RFC 4648 compliant base16, base32, and base64 encoding library for .NET Standard 1.1
C# Batchfile
Branch: master
Clone or download
Pull request Compare This branch is 5 commits ahead, 1 commit behind wujikui:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.nuget
BaseNEncodings
Benchmark
Simple
.gitignore
.travis.yml
BaseNEncodings.Net.sln
LICENSE
README.md
RFC 4648.txt
appveyor.yml
global.json

README.md

BaseNEncodings.Net

BaseNEncodings.Net is an RFC 4648 compliant base16, base32, and base64 encoding library for .NET Standard 1.1.

Windows Build status
Linux/OSX Build Status
NuGet Package

This repository was forked from https://github.com/wallf/BaseNEncodings.Net and retargeted to .NET Standard 1.1. The original readme is preserved below, with modifications where appropriate.

The project java-base-n-encodings was migrated from BaseNEncodings.Net.

Features

  • 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.

Installation

Basic Usage

  1. Adds a reference of the assembly in you project.

     PM> Install-Package SapientGuardian.BaseNEncodings
    
  2. Using the WallF.BaseNEncodings namespace.

     using WallF.BaseNEncodings;
    
  3. 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");
    
  4. 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
    

Documentation, Simple and Benchmark

  • Documentation comments as the generated XML file(WallF.BaseNEncodings.xml) is included in the package.
  • Repository includes the simple and benchmark subprojects.
You can’t perform that action at this time.