Skip to content

Instantly share code, notes, and snippets.

View wmadden's full-sized avatar

Will Madden wmadden

  • Remerge
  • Berlin, Germany
View GitHub Profile
@wmadden
wmadden / gist:f30178506367bad97d02
Last active August 29, 2015 14:22
A way to convert a decimal number to an arbitrary base string representation and back
// Converts a given decimal number into a base 26 string representation, e.g.
// 0 -> A
// 1 -> B
// 25 -> Z
// 26 -> BA
// 26*26 -> BAA
function stringCodeFromNumber(number) {
return stringifyNumberArray(convertDecimalToNewBase(number, 26, 0), "A");
}