@@ -125,6 +125,8 @@ | |||||
<!-- External libraries --> | <!-- External libraries --> | ||||
<script type="text/javascript"> | <script type="text/javascript"> | ||||
// SRC: https://github.com/beatgammit/base64-js | |||||
(function(r){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=r()}else if(typeof define==="function"&&define.amd){define([],r)}else{var e;if(typeof window!=="undefined"){e=window}else if(typeof global!=="undefined"){e=global}else if(typeof self!=="undefined"){e=self}else{e=this}e.base64js=r()}})(function(){var r,e,n;return function(){function r(e,n,t){function o(f,i){if(!n[f]){if(!e[f]){var u="function"==typeof require&&require;if(!i&&u)return u(f,!0);if(a)return a(f,!0);var v=new Error("Cannot find module '"+f+"'");throw v.code="MODULE_NOT_FOUND",v}var d=n[f]={exports:{}};e[f][0].call(d.exports,function(r){var n=e[f][1][r];return o(n||r)},d,d.exports,r,e,n,t)}return n[f].exports}for(var a="function"==typeof require&&require,f=0;f<t.length;f++)o(t[f]);return o}return r}()({"/":[function(r,e,n){"use strict";n.byteLength=d;n.toByteArray=h;n.fromByteArray=p;var t=[];var o=[];var a=typeof Uint8Array!=="undefined"?Uint8Array:Array;var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,u=f.length;i<u;++i){t[i]=f[i];o[f.charCodeAt(i)]=i}o["-".charCodeAt(0)]=62;o["_".charCodeAt(0)]=63;function v(r){var e=r.length;if(e%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var n=r.indexOf("=");if(n===-1)n=e;var t=n===e?0:4-n%4;return[n,t]}function d(r){var e=v(r);var n=e[0];var t=e[1];return(n+t)*3/4-t}function c(r,e,n){return(e+n)*3/4-n}function h(r){var e;var n=v(r);var t=n[0];var f=n[1];var i=new a(c(r,t,f));var u=0;var d=f>0?t-4:t;for(var h=0;h<d;h+=4){e=o[r.charCodeAt(h)]<<18|o[r.charCodeAt(h+1)]<<12|o[r.charCodeAt(h+2)]<<6|o[r.charCodeAt(h+3)];i[u++]=e>>16&255;i[u++]=e>>8&255;i[u++]=e&255}if(f===2){e=o[r.charCodeAt(h)]<<2|o[r.charCodeAt(h+1)]>>4;i[u++]=e&255}if(f===1){e=o[r.charCodeAt(h)]<<10|o[r.charCodeAt(h+1)]<<4|o[r.charCodeAt(h+2)]>>2;i[u++]=e>>8&255;i[u++]=e&255}return i}function s(r){return t[r>>18&63]+t[r>>12&63]+t[r>>6&63]+t[r&63]}function l(r,e,n){var t;var o=[];for(var a=e;a<n;a+=3){t=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(r[a+2]&255);o.push(s(t))}return o.join("")}function p(r){var e;var n=r.length;var o=n%3;var a=[];var f=16383;for(var i=0,u=n-o;i<u;i+=f){a.push(l(r,i,i+f>u?u:i+f))}if(o===1){e=r[n-1];a.push(t[e>>2]+t[e<<4&63]+"==")}else if(o===2){e=(r[n-2]<<8)+r[n-1];a.push(t[e>>10]+t[e>>4&63]+t[e<<2&63]+"=")}return a.join("")}},{}]},{},[])("/")}); | |||||
// SRC: https://github.com/solderjs/TextEncoderLite | // SRC: https://github.com/solderjs/TextEncoderLite | ||||
function TextEncoderLite() { | function TextEncoderLite() { | ||||
} | } | ||||
@@ -266,8 +268,6 @@ | |||||
module.exports.TextDecoderLite = TextDecoderLite; | module.exports.TextDecoderLite = TextDecoderLite; | ||||
module.exports.TextEncoderLite = TextEncoderLite; | module.exports.TextEncoderLite = TextEncoderLite; | ||||
} | } | ||||
// SRC: https://github.com/beatgammit/base64-js | |||||
(function(r){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=r()}else if(typeof define==="function"&&define.amd){define([],r)}else{var e;if(typeof window!=="undefined"){e=window}else if(typeof global!=="undefined"){e=global}else if(typeof self!=="undefined"){e=self}else{e=this}e.base64js=r()}})(function(){var r,e,n;return function(){function r(e,n,t){function o(f,i){if(!n[f]){if(!e[f]){var u="function"==typeof require&&require;if(!i&&u)return u(f,!0);if(a)return a(f,!0);var v=new Error("Cannot find module '"+f+"'");throw v.code="MODULE_NOT_FOUND",v}var d=n[f]={exports:{}};e[f][0].call(d.exports,function(r){var n=e[f][1][r];return o(n||r)},d,d.exports,r,e,n,t)}return n[f].exports}for(var a="function"==typeof require&&require,f=0;f<t.length;f++)o(t[f]);return o}return r}()({"/":[function(r,e,n){"use strict";n.byteLength=d;n.toByteArray=h;n.fromByteArray=p;var t=[];var o=[];var a=typeof Uint8Array!=="undefined"?Uint8Array:Array;var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,u=f.length;i<u;++i){t[i]=f[i];o[f.charCodeAt(i)]=i}o["-".charCodeAt(0)]=62;o["_".charCodeAt(0)]=63;function v(r){var e=r.length;if(e%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var n=r.indexOf("=");if(n===-1)n=e;var t=n===e?0:4-n%4;return[n,t]}function d(r){var e=v(r);var n=e[0];var t=e[1];return(n+t)*3/4-t}function c(r,e,n){return(e+n)*3/4-n}function h(r){var e;var n=v(r);var t=n[0];var f=n[1];var i=new a(c(r,t,f));var u=0;var d=f>0?t-4:t;for(var h=0;h<d;h+=4){e=o[r.charCodeAt(h)]<<18|o[r.charCodeAt(h+1)]<<12|o[r.charCodeAt(h+2)]<<6|o[r.charCodeAt(h+3)];i[u++]=e>>16&255;i[u++]=e>>8&255;i[u++]=e&255}if(f===2){e=o[r.charCodeAt(h)]<<2|o[r.charCodeAt(h+1)]>>4;i[u++]=e&255}if(f===1){e=o[r.charCodeAt(h)]<<10|o[r.charCodeAt(h+1)]<<4|o[r.charCodeAt(h+2)]>>2;i[u++]=e>>8&255;i[u++]=e&255}return i}function s(r){return t[r>>18&63]+t[r>>12&63]+t[r>>6&63]+t[r&63]}function l(r,e,n){var t;var o=[];for(var a=e;a<n;a+=3){t=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(r[a+2]&255);o.push(s(t))}return o.join("")}function p(r){var e;var n=r.length;var o=n%3;var a=[];var f=16383;for(var i=0,u=n-o;i<u;i+=f){a.push(l(r,i,i+f>u?u:i+f))}if(o===1){e=r[n-1];a.push(t[e>>2]+t[e<<4&63]+"==")}else if(o===2){e=(r[n-2]<<8)+r[n-1];a.push(t[e>>10]+t[e>>4&63]+t[e<<2&63]+"=")}return a.join("")}},{}]},{},[])("/")}); | |||||
// SRC: https://github.com/nodeca/pako | // SRC: https://github.com/nodeca/pako | ||||
/* pako 1.0.10 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | /* pako 1.0.10 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||||
'use strict'; | 'use strict'; | ||||
@@ -7087,6 +7087,29 @@ | |||||
},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/") | },{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/") | ||||
}); | }); | ||||
// SRC: https://developer.mozilla.org/ru/docs/Web/API/WindowBase64/Base64_encoding_and_decoding | |||||
function base64Encode(str) | |||||
{ | |||||
var bytes = new (TextEncoder || TextEncoderLite)("utf-8").encode(str); | |||||
return base64js.fromByteArray(bytes); | |||||
} | |||||
function base64Decode(str) | |||||
{ | |||||
var bytes = base64js.toByteArray(str); | |||||
return new (TextDecoder || TextDecoderLite)("utf-8").decode(bytes); | |||||
} | |||||
function zipBase64Encode(input) | |||||
{ | |||||
var bytes = new (TextEncoder || TextEncoderLite)("utf-8").encode(input); | |||||
var zipValue = window.pako.deflate(bytes, {to: 'string'}); | |||||
return base64Encode(zipValue); | |||||
} | |||||
function zipBase64Decode(input) | |||||
{ | |||||
var zipValue = base64Decode(input); | |||||
var bytes = window.pako.inflate(zipValue) | |||||
return new (TextDecoder || TextDecoderLite)("utf-8").decode(bytes); | |||||
} | |||||
</script> | </script> | ||||
<!-- Reusable functions --> | <!-- Reusable functions --> | ||||
@@ -7112,17 +7135,6 @@ | |||||
; | ; | ||||
}); | }); | ||||
}; | }; | ||||
// SRC: https://developer.mozilla.org/ru/docs/Web/API/WindowBase64/Base64_encoding_and_decoding | |||||
function base64Encode(str) | |||||
{ | |||||
var bytes = new (TextEncoder || TextEncoderLite)("utf-8").encode(str); | |||||
return base64js.fromByteArray(bytes); | |||||
} | |||||
function base64Decode(str) | |||||
{ | |||||
var bytes = base64js.toByteArray(str); | |||||
return new (TextDecoder || TextDecoderLite)("utf-8").decode(bytes); | |||||
} | |||||
</script> | </script> | ||||
<!-- Tool --> | <!-- Tool --> | ||||
@@ -7191,9 +7203,7 @@ | |||||
var input = document.getElementById("input"); | var input = document.getElementById("input"); | ||||
var output = document.getElementById("output"); | var output = document.getElementById("output"); | ||||
var bytes = new (TextEncoder || TextEncoderLite)("utf-8").encode(input.value); | |||||
var zipValue = window.pako.deflate(bytes, {to: 'string'}); | |||||
output.value = base64Encode(zipValue); | |||||
output.value = zipBase64Encode(input.value) | |||||
this.LOG("В_ЗИП_БАЗУ64", input.value.length, output.value.length); | this.LOG("В_ЗИП_БАЗУ64", input.value.length, output.value.length); | ||||
} | } | ||||
@@ -7202,9 +7212,7 @@ | |||||
var input = document.getElementById("input"); | var input = document.getElementById("input"); | ||||
var output = document.getElementById("output"); | var output = document.getElementById("output"); | ||||
var zipValue = base64Decode(input.value); | |||||
var bytes = window.pako.inflate(zipValue) | |||||
output.value = new (TextDecoder || TextDecoderLite)("utf-8").decode(bytes); | |||||
output.value = zipBase64Decode(input.value) | |||||
this.LOG("ИЗ_ЗИП_БАЗЫ64", input.value.length, output.value.length); | this.LOG("ИЗ_ЗИП_БАЗЫ64", input.value.length, output.value.length); | ||||
} | } | ||||
@@ -125,6 +125,8 @@ | |||||
<!-- External libraries --> | <!-- External libraries --> | ||||
<script type="text/javascript"> | <script type="text/javascript"> | ||||
// SRC: https://github.com/beatgammit/base64-js | |||||
(function(r){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=r()}else if(typeof define==="function"&&define.amd){define([],r)}else{var e;if(typeof window!=="undefined"){e=window}else if(typeof global!=="undefined"){e=global}else if(typeof self!=="undefined"){e=self}else{e=this}e.base64js=r()}})(function(){var r,e,n;return function(){function r(e,n,t){function o(f,i){if(!n[f]){if(!e[f]){var u="function"==typeof require&&require;if(!i&&u)return u(f,!0);if(a)return a(f,!0);var v=new Error("Cannot find module '"+f+"'");throw v.code="MODULE_NOT_FOUND",v}var d=n[f]={exports:{}};e[f][0].call(d.exports,function(r){var n=e[f][1][r];return o(n||r)},d,d.exports,r,e,n,t)}return n[f].exports}for(var a="function"==typeof require&&require,f=0;f<t.length;f++)o(t[f]);return o}return r}()({"/":[function(r,e,n){"use strict";n.byteLength=d;n.toByteArray=h;n.fromByteArray=p;var t=[];var o=[];var a=typeof Uint8Array!=="undefined"?Uint8Array:Array;var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,u=f.length;i<u;++i){t[i]=f[i];o[f.charCodeAt(i)]=i}o["-".charCodeAt(0)]=62;o["_".charCodeAt(0)]=63;function v(r){var e=r.length;if(e%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var n=r.indexOf("=");if(n===-1)n=e;var t=n===e?0:4-n%4;return[n,t]}function d(r){var e=v(r);var n=e[0];var t=e[1];return(n+t)*3/4-t}function c(r,e,n){return(e+n)*3/4-n}function h(r){var e;var n=v(r);var t=n[0];var f=n[1];var i=new a(c(r,t,f));var u=0;var d=f>0?t-4:t;for(var h=0;h<d;h+=4){e=o[r.charCodeAt(h)]<<18|o[r.charCodeAt(h+1)]<<12|o[r.charCodeAt(h+2)]<<6|o[r.charCodeAt(h+3)];i[u++]=e>>16&255;i[u++]=e>>8&255;i[u++]=e&255}if(f===2){e=o[r.charCodeAt(h)]<<2|o[r.charCodeAt(h+1)]>>4;i[u++]=e&255}if(f===1){e=o[r.charCodeAt(h)]<<10|o[r.charCodeAt(h+1)]<<4|o[r.charCodeAt(h+2)]>>2;i[u++]=e>>8&255;i[u++]=e&255}return i}function s(r){return t[r>>18&63]+t[r>>12&63]+t[r>>6&63]+t[r&63]}function l(r,e,n){var t;var o=[];for(var a=e;a<n;a+=3){t=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(r[a+2]&255);o.push(s(t))}return o.join("")}function p(r){var e;var n=r.length;var o=n%3;var a=[];var f=16383;for(var i=0,u=n-o;i<u;i+=f){a.push(l(r,i,i+f>u?u:i+f))}if(o===1){e=r[n-1];a.push(t[e>>2]+t[e<<4&63]+"==")}else if(o===2){e=(r[n-2]<<8)+r[n-1];a.push(t[e>>10]+t[e>>4&63]+t[e<<2&63]+"=")}return a.join("")}},{}]},{},[])("/")}); | |||||
// SRC: https://github.com/solderjs/TextEncoderLite | // SRC: https://github.com/solderjs/TextEncoderLite | ||||
function TextEncoderLite() { | function TextEncoderLite() { | ||||
} | } | ||||
@@ -266,8 +268,6 @@ | |||||
module.exports.TextDecoderLite = TextDecoderLite; | module.exports.TextDecoderLite = TextDecoderLite; | ||||
module.exports.TextEncoderLite = TextEncoderLite; | module.exports.TextEncoderLite = TextEncoderLite; | ||||
} | } | ||||
// SRC: https://github.com/beatgammit/base64-js | |||||
(function(r){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=r()}else if(typeof define==="function"&&define.amd){define([],r)}else{var e;if(typeof window!=="undefined"){e=window}else if(typeof global!=="undefined"){e=global}else if(typeof self!=="undefined"){e=self}else{e=this}e.base64js=r()}})(function(){var r,e,n;return function(){function r(e,n,t){function o(f,i){if(!n[f]){if(!e[f]){var u="function"==typeof require&&require;if(!i&&u)return u(f,!0);if(a)return a(f,!0);var v=new Error("Cannot find module '"+f+"'");throw v.code="MODULE_NOT_FOUND",v}var d=n[f]={exports:{}};e[f][0].call(d.exports,function(r){var n=e[f][1][r];return o(n||r)},d,d.exports,r,e,n,t)}return n[f].exports}for(var a="function"==typeof require&&require,f=0;f<t.length;f++)o(t[f]);return o}return r}()({"/":[function(r,e,n){"use strict";n.byteLength=d;n.toByteArray=h;n.fromByteArray=p;var t=[];var o=[];var a=typeof Uint8Array!=="undefined"?Uint8Array:Array;var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,u=f.length;i<u;++i){t[i]=f[i];o[f.charCodeAt(i)]=i}o["-".charCodeAt(0)]=62;o["_".charCodeAt(0)]=63;function v(r){var e=r.length;if(e%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var n=r.indexOf("=");if(n===-1)n=e;var t=n===e?0:4-n%4;return[n,t]}function d(r){var e=v(r);var n=e[0];var t=e[1];return(n+t)*3/4-t}function c(r,e,n){return(e+n)*3/4-n}function h(r){var e;var n=v(r);var t=n[0];var f=n[1];var i=new a(c(r,t,f));var u=0;var d=f>0?t-4:t;for(var h=0;h<d;h+=4){e=o[r.charCodeAt(h)]<<18|o[r.charCodeAt(h+1)]<<12|o[r.charCodeAt(h+2)]<<6|o[r.charCodeAt(h+3)];i[u++]=e>>16&255;i[u++]=e>>8&255;i[u++]=e&255}if(f===2){e=o[r.charCodeAt(h)]<<2|o[r.charCodeAt(h+1)]>>4;i[u++]=e&255}if(f===1){e=o[r.charCodeAt(h)]<<10|o[r.charCodeAt(h+1)]<<4|o[r.charCodeAt(h+2)]>>2;i[u++]=e>>8&255;i[u++]=e&255}return i}function s(r){return t[r>>18&63]+t[r>>12&63]+t[r>>6&63]+t[r&63]}function l(r,e,n){var t;var o=[];for(var a=e;a<n;a+=3){t=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(r[a+2]&255);o.push(s(t))}return o.join("")}function p(r){var e;var n=r.length;var o=n%3;var a=[];var f=16383;for(var i=0,u=n-o;i<u;i+=f){a.push(l(r,i,i+f>u?u:i+f))}if(o===1){e=r[n-1];a.push(t[e>>2]+t[e<<4&63]+"==")}else if(o===2){e=(r[n-2]<<8)+r[n-1];a.push(t[e>>10]+t[e>>4&63]+t[e<<2&63]+"=")}return a.join("")}},{}]},{},[])("/")}); | |||||
// SRC: https://github.com/nodeca/pako | // SRC: https://github.com/nodeca/pako | ||||
/* pako 1.0.10 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | /* pako 1.0.10 nodeca/pako */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.pako = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||||
'use strict'; | 'use strict'; | ||||
@@ -7087,6 +7087,29 @@ | |||||
},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/") | },{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/") | ||||
}); | }); | ||||
// SRC: https://developer.mozilla.org/ru/docs/Web/API/WindowBase64/Base64_encoding_and_decoding | |||||
function base64Encode(str) | |||||
{ | |||||
var bytes = new (TextEncoder || TextEncoderLite)("utf-8").encode(str); | |||||
return base64js.fromByteArray(bytes); | |||||
} | |||||
function base64Decode(str) | |||||
{ | |||||
var bytes = base64js.toByteArray(str); | |||||
return new (TextDecoder || TextDecoderLite)("utf-8").decode(bytes); | |||||
} | |||||
function zipBase64Encode(input) | |||||
{ | |||||
var bytes = new (TextEncoder || TextEncoderLite)("utf-8").encode(input); | |||||
var zipValue = window.pako.deflate(bytes, {to: 'string'}); | |||||
return base64Encode(zipValue); | |||||
} | |||||
function zipBase64Decode(input) | |||||
{ | |||||
var zipValue = base64Decode(input); | |||||
var bytes = window.pako.inflate(zipValue) | |||||
return new (TextDecoder || TextDecoderLite)("utf-8").decode(bytes); | |||||
} | |||||
</script> | </script> | ||||
<!-- Reusable functions --> | <!-- Reusable functions --> | ||||
@@ -7112,17 +7135,6 @@ | |||||
; | ; | ||||
}); | }); | ||||
}; | }; | ||||
// SRC: https://developer.mozilla.org/ru/docs/Web/API/WindowBase64/Base64_encoding_and_decoding | |||||
function base64Encode(str) | |||||
{ | |||||
var bytes = new (TextEncoder || TextEncoderLite)("utf-8").encode(str); | |||||
return base64js.fromByteArray(bytes); | |||||
} | |||||
function base64Decode(str) | |||||
{ | |||||
var bytes = base64js.toByteArray(str); | |||||
return new (TextDecoder || TextDecoderLite)("utf-8").decode(bytes); | |||||
} | |||||
</script> | </script> | ||||
<!-- Tool --> | <!-- Tool --> | ||||
@@ -7191,9 +7203,7 @@ | |||||
var input = document.getElementById("input"); | var input = document.getElementById("input"); | ||||
var output = document.getElementById("output"); | var output = document.getElementById("output"); | ||||
var bytes = new (TextEncoder || TextEncoderLite)("utf-8").encode(input.value); | |||||
var zipValue = window.pako.deflate(bytes, {to: 'string'}); | |||||
output.value = base64Encode(zipValue); | |||||
output.value = zipBase64Encode(input.value) | |||||
this.LOG("В_ЗИП_БАЗУ64", input.value.length, output.value.length); | this.LOG("В_ЗИП_БАЗУ64", input.value.length, output.value.length); | ||||
} | } | ||||
@@ -7202,9 +7212,7 @@ | |||||
var input = document.getElementById("input"); | var input = document.getElementById("input"); | ||||
var output = document.getElementById("output"); | var output = document.getElementById("output"); | ||||
var zipValue = base64Decode(input.value); | |||||
var bytes = window.pako.inflate(zipValue) | |||||
output.value = new (TextDecoder || TextDecoderLite)("utf-8").decode(bytes); | |||||
output.value = zipBase64Decode(input.value) | |||||
this.LOG("ИЗ_ЗИП_БАЗЫ64", input.value.length, output.value.length); | this.LOG("ИЗ_ЗИП_БАЗЫ64", input.value.length, output.value.length); | ||||
} | } | ||||