This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const compile = (() => { | |
const N = n => { | |
if (n === 0) return '+[]'; | |
return Array.from({ length: n }, () => '+!![]').join(' + '); | |
} | |
const M = {}; | |
const S = s => s.split('').map(x => { | |
return M[x] || `([]+[])[${S(c)}][${S('fromCharCode')}](${N(x.charCodeAt(0))})`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// const N = n => { | |
// if (n === 0) return '+[]'; | |
// return Array.from({length: n}, () => '+!![]').join(' + '); | |
// } | |
// const M = {}; | |
// const S = s =>s.split('').map(x => { | |
// if (!(x in M)) { | |
// const charCode = x.charCodeAt(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LZStringDEBA = (function () { | |
"use strict"; | |
// private property | |
var fromCharCode = String.fromCharCode, | |
streamData = null, | |
streamVal = 0, | |
streamPos = 0; | |
function streamBits(token, numBitsMask) { | |
for (var i = 0; numBitsMask >>= 1; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const count32 = new Uint32Array(256), | |
count16 = new Uint16Array(256); | |
function radixU8(input) { | |
if (input.length < (1 << 16)) { | |
return radixU8_16(input); | |
} else { | |
return radixU8_32(input); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2013 Pieroxy <pieroxy@pieroxy.net> | |
// Asyncish version by Job van der Zwan (2018) | |
// This work is free. You can redistribute it and/or modify it | |
// under the terms of the WTFPL, Version 2 | |
// For more information see LICENSE.txt or http://www.wtfpl.net/ | |
// | |
// For more information, the home page: | |
// http://pieroxy.net/blog/pages/lz-string/testing.html | |
// | |
// LZ-based compression algorithm, version 2.0 RC |