Skip to content
/ net-36 Public

Encodes base 10 to base 36 and decodes base 36 to base 10.

Notifications You must be signed in to change notification settings

tallesl/net-36

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

36

Base 10 to base 36 and vice versa.

Usage

using Base36Library;

// Encoding
Base36.Encode(10);    // returns "A"
Base36.Encode(10000); // returns "7PS"

// Decoding
Base36.Decode("Z");   // returns 35L
Base36.Decode("10");  // returns 36L
Base36.Decode("7PS"); // returns 10000L

// Comparing
Base36.Compare("A", "A"); // 0
Base36.Compare("A", "Z"); // 1
Base36.Compare("Z", "A"); // -1

// Checking for overflow
Base36.WouldOverflow("BARRELROLL"); // False
Base36.WouldOverflow("DOABARRELROLL"); // True