Skip to content

Instantly share code, notes, and snippets.

View sebastiandelaroche's full-sized avatar
🤙

Sebastian De La Roche sebastiandelaroche

🤙
  • kerthin
View GitHub Profile
function decodeInt(text) {
const index = text.indexOf("e");
const integer = text.slice(1, index);
return [index + 1, integer];
}
function decodeString(text) {
const [textLength] = text.split(":");
const length = Number(textLength);
return [2 + length, text.slice(2, 2 + length)];