From 7eb8fc58e1d9418e349eb2dc69400c5bdca62c6e Mon Sep 17 00:00:00 2001 From: Michael Kapelko Date: Sun, 14 Jul 2019 14:55:34 +0300 Subject: [PATCH] Update site-zipbase64 --- zipbase64/en/zipbase64_1.0.0.html | 46 ++++++++++++++++------------ zipbase64/ru/zipbase64_1.0.0+ru.html | 46 ++++++++++++++++------------ 2 files changed, 54 insertions(+), 38 deletions(-) diff --git a/zipbase64/en/zipbase64_1.0.0.html b/zipbase64/en/zipbase64_1.0.0.html index f47a0c9..98391ec 100644 --- a/zipbase64/en/zipbase64_1.0.0.html +++ b/zipbase64/en/zipbase64_1.0.0.html @@ -125,6 +125,8 @@ @@ -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); - } @@ -7191,9 +7203,7 @@ var input = document.getElementById("input"); 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); } @@ -7202,9 +7212,7 @@ var input = document.getElementById("input"); 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); } diff --git a/zipbase64/ru/zipbase64_1.0.0+ru.html b/zipbase64/ru/zipbase64_1.0.0+ru.html index cf6cd9f..972e677 100644 --- a/zipbase64/ru/zipbase64_1.0.0+ru.html +++ b/zipbase64/ru/zipbase64_1.0.0+ru.html @@ -125,6 +125,8 @@ @@ -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); - } @@ -7191,9 +7203,7 @@ var input = document.getElementById("input"); 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); } @@ -7202,9 +7212,7 @@ var input = document.getElementById("input"); 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); }