Library for url-compatible base64 encoding/decoding. Base64 generated from this library is sortable, so it can be use as key. And there is no padding, so generated text is more clean.
basic encoding/decoding from string
var base64Text = Base64.GetBase64("Text to encode");
var decodedText = Base64.ToString(base64Text);
this will create base64 text from Guid
var id = Base64.NewId();
use TimeId to create ascending/descending id
var asc = TimeId.NewSortableId(ascending: true);
var desc = TimeId.NewSortableId();
This is for writing/reading multiple values
var writer = new Base64Writer();
writer.Write(1);
writer.WriteVar("Text");
var base64 = writer.ToString();
var reader = new Base64Reader(base64);
var i = reader.ReadInt32();
var s = reader.ReadVarString();
You can also encrypt base64 text, this will use MachineKey for encryption/decryption
var writer = new Base64Encryptor("test");
writer.Write(1);
writer.WriteVar("Text");
var base64 = writer.ToString();
var reader = new Base64Decryptor(base64, "test");
var i = reader.ReadInt32();
var s = reader.ReadVarString();