lz-string.min.js
600 Bytes
!function(r,e){var n={compress:function(r){"use strict";var e,n,t,o={},i="",f=[],a=65536;for(e=0;e<r.length;e+=1)n=r.charAt(e),t=i+n,o.hasOwnProperty(t)?i=t:(i&&!o[i]&&(o[i]=i.charCodeAt()),o[i]&&(f.push(o[i]),o[t]=a++),i=String(n));return""!==i&&f.push(o[i]||i.charCodeAt()),f.join(",")},decompress:function(r){"use strict";var e,n,t,o,i=[],f="",a=65536;for(n=String.fromCharCode(r[0]),t=n,e=1;e<r.length;e+=1)o=r[e],f=i[o]?i[o]:o===a?n+n.charAt(0):String.fromCharCode(o),t+=f,i[a++]=n+f.charAt(0),n=f;return t}};"undefined"!=typeof define&&define.amd&&define(function(){return n}),r.LZW=n}(window);