diff --git a/hexstrbase64/fail.png b/hexstrbase64/fail.png deleted file mode 100644 index bbebb5d..0000000 Binary files a/hexstrbase64/fail.png and /dev/null differ diff --git a/hexstrbase64/hexstrbase64/base64.js b/hexstrbase64/hexstrbase64/base64.js deleted file mode 100644 index a995d36..0000000 --- a/hexstrbase64/hexstrbase64/base64.js +++ /dev/null @@ -1,124 +0,0 @@ -//Base64.js for hexstrbase64 library for Node.js -/* - * Copyright (c) 2012 Miles Shang - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * Usage: - * Set your settings: - * base64.settings.char62 = "-"; - * base64.settings.char63 = "_"; - * etc. - * - * Then: - * base64.encode(str) takes a string and returns the base64 encoding of it. - * base64.decode(str) does the reverse. - */ - -/* TODO: - * Add a "padding_mandatory" flag to check for bad padding in the decoder. - * Add test cases that throw errors. - */ - -var base64 = new Object(); - -base64.settings = { // defaults - "char62" : "+", - "char63" : "/", - "pad" : "=", - "ascii" : false -}; - -/* - * Settings: - * If "pad" is not null or undefined, then it will be used for encoding. - * - * If "ascii" is set to true, then the encoder - * will assume that plaintext is in 8-bit chars (the standard). - * In this case, for every 3 chars in plaintext, you get 4 chars of base64. - * Any non-8-bit chars will cause an error. - * Otherwise, assume that all plaintext can be in the full range - * of Javascript chars, i.e. 16 bits. Get 8 chars of base64 for 3 chars - * of plaintext. Any possible JS string can be encoded. - */ - -base64.encode = function (str) { - this.char_set = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" - + this.settings.char62 + this.settings.char63; - - var output = ""; // final output - var buf = ""; // binary buffer - for (var i = 0; i < str.length; ++i) { - var c_num = str.charCodeAt(i); - if (this.settings.ascii) - if (c_num >= 256) - throw "Not an 8-bit char."; - var c_bin = c_num.toString(2); - while (c_bin.length < (this.settings.ascii ? 8 : 16)) - c_bin = "0" + c_bin; - buf += c_bin; - - while (buf.length >= 6) { - var sextet = buf.slice(0, 6); - buf = buf.slice(6); - output += this.char_set.charAt(parseInt(sextet, 2)); - } - } - - if (buf) { // not empty - while (buf.length < 6) buf += "0"; - output += this.char_set.charAt(parseInt(buf, 2)); - } - - if (this.settings.pad) - while (output.length % (this.settings.ascii ? 4 : 8) != 0) - output += this.settings.pad; - - return output; -} - -base64.decode = function (str) { - this.char_set = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" - + this.settings.char62 + this.settings.char63; - - var output = ""; // final output - var buf = ""; // binary buffer - var bits = (this.settings.ascii ? 8 : 16); - for (var i = 0; i < str.length; ++i) { - if (str[i] == this.settings.pad) break; - var c_num = this.char_set.indexOf(str.charAt(i)); - if (c_num == -1) throw "Not base64."; - var c_bin = c_num.toString(2); - while (c_bin.length < 6) c_bin = "0" + c_bin; - buf += c_bin; - - while (buf.length >= bits) { - var octet = buf.slice(0, bits); - buf = buf.slice(bits); - output += String.fromCharCode(parseInt(octet, 2)); - } - } - return output; -} -module.exports = base64; \ No newline at end of file diff --git a/hexstrbase64/hexstrbase64/base64_browser.js b/hexstrbase64/hexstrbase64/base64_browser.js deleted file mode 100644 index 44dec66..0000000 --- a/hexstrbase64/hexstrbase64/base64_browser.js +++ /dev/null @@ -1,123 +0,0 @@ -//Base64.js for hexstrbase64 library for browser -/* - * Copyright (c) 2012 Miles Shang - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * Usage: - * Set your settings: - * base64.settings.char62 = "-"; - * base64.settings.char63 = "_"; - * etc. - * - * Then: - * base64.encode(str) takes a string and returns the base64 encoding of it. - * base64.decode(str) does the reverse. - */ - -/* TODO: - * Add a "padding_mandatory" flag to check for bad padding in the decoder. - * Add test cases that throw errors. - */ - -var base64 = new Object(); - -base64.settings = { // defaults - "char62" : "+", - "char63" : "/", - "pad" : "=", - "ascii" : false -}; - -/* - * Settings: - * If "pad" is not null or undefined, then it will be used for encoding. - * - * If "ascii" is set to true, then the encoder - * will assume that plaintext is in 8-bit chars (the standard). - * In this case, for every 3 chars in plaintext, you get 4 chars of base64. - * Any non-8-bit chars will cause an error. - * Otherwise, assume that all plaintext can be in the full range - * of Javascript chars, i.e. 16 bits. Get 8 chars of base64 for 3 chars - * of plaintext. Any possible JS string can be encoded. - */ - -base64.encode = function (str) { - this.char_set = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" - + this.settings.char62 + this.settings.char63; - - var output = ""; // final output - var buf = ""; // binary buffer - for (var i = 0; i < str.length; ++i) { - var c_num = str.charCodeAt(i); - if (this.settings.ascii) - if (c_num >= 256) - throw "Not an 8-bit char."; - var c_bin = c_num.toString(2); - while (c_bin.length < (this.settings.ascii ? 8 : 16)) - c_bin = "0" + c_bin; - buf += c_bin; - - while (buf.length >= 6) { - var sextet = buf.slice(0, 6); - buf = buf.slice(6); - output += this.char_set.charAt(parseInt(sextet, 2)); - } - } - - if (buf) { // not empty - while (buf.length < 6) buf += "0"; - output += this.char_set.charAt(parseInt(buf, 2)); - } - - if (this.settings.pad) - while (output.length % (this.settings.ascii ? 4 : 8) != 0) - output += this.settings.pad; - - return output; -} - -base64.decode = function (str) { - this.char_set = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" - + this.settings.char62 + this.settings.char63; - - var output = ""; // final output - var buf = ""; // binary buffer - var bits = (this.settings.ascii ? 8 : 16); - for (var i = 0; i < str.length; ++i) { - if (str[i] == this.settings.pad) break; - var c_num = this.char_set.indexOf(str.charAt(i)); - if (c_num == -1) throw "Not base64."; - var c_bin = c_num.toString(2); - while (c_bin.length < 6) c_bin = "0" + c_bin; - buf += c_bin; - - while (buf.length >= bits) { - var octet = buf.slice(0, bits); - buf = buf.slice(bits); - output += String.fromCharCode(parseInt(octet, 2)); - } - } - return output; -} \ No newline at end of file diff --git a/hexstrbase64/hexstrbase64/main.js b/hexstrbase64/hexstrbase64/main.js deleted file mode 100644 index 4f3d12d..0000000 --- a/hexstrbase64/hexstrbase64/main.js +++ /dev/null @@ -1,129 +0,0 @@ -//Requires base64 -var base64 = require('./base64.js'); -var HexStrBase64Buffer = { - from: function(s, e) { - var type = e; - var value = ''; - if (e == 'base64') { - value = base64.decode(s); - } else if (e == 'hex') { - try { - var escaped = ""; - var hex = ""; - if(s.length%4 > 0) { - for(i=0;i<(4-(s.length%4));i++) { - hex += "0"; - } - } - hex += s; - for(var i = 0;i 4) { - result += hex.substring(hex.length-5,hex.length-1); - } else if(hex.length < 4) { - for(var j=0;j<=4-(hex.length%4);j++) { - result += "0"; - } - result += hex; - } - } - return result.split("undefined").join("").split("%").join(""); - } else { - //return Buffer.from(value, type).toString(en); - return Buffer.from(value,"utf8").toString(en); - } - } - //} - //function toString(en) { - //return toStringE(en,type); - //} - return { type: type, value: value, toString: toString }; - } -}; -var hexstrbase64 = { - strtobase64: function(s) { - return HexStrBase64Buffer.from(s, 'utf8').toString('base64'); - }, - base64tostr: function(b) { - return HexStrBase64Buffer.from(b, 'base64').toString('utf8'); - }, - strtohex: function(s) { - return HexStrBase64Buffer.from(s, 'utf8').toString('hex'); - }, - hextostr: function(h) { - return HexStrBase64Buffer.from(h, 'hex').toString('utf8'); - }, - hextobase64: function(h) { - return hexstrbase64.strtobase64(hexstrbase64.hextostr(h)); - }, - base64tohex: function(b) { - return hexstrbase64.strtohex(hexstrbase64.base64tostr(b)); - }, - cipher: function() { - this.strtobase64 = hexstrbase64.strtobase64; - this.base64tostr = hexstrbase64.base64tostr; - this.strtohex = hexstrbase64.strtohex; - this.hextostr = hexstrbase64.hextostr; - this.hextobase64 = hextobase64.hextobase64; - this.base64tohex = hextobase64.base64tohex; - }, - native: { - btoa: function(b) { - return hexstrbase64.strtobase64(b); - }, - atob: function(a) { - return hexstrbase64.base64tostr(a); - } - } -}; -module.exports = hexstrbase64; \ No newline at end of file diff --git a/hexstrbase64/hexstrbase64/main_browser.js b/hexstrbase64/hexstrbase64/main_browser.js deleted file mode 100644 index a2b4531..0000000 --- a/hexstrbase64/hexstrbase64/main_browser.js +++ /dev/null @@ -1,126 +0,0 @@ -//Requires base64_browser.js -var HexStrBase64Buffer = { - from: function(s, e) { - var type = e; - var value = ''; - if (e == 'base64') { - value = base64.decode(s); - } else if (e == 'hex') { - try { - var escaped = ""; - var hex = ""; - if(s.length%4 > 0) { - for(i=0;i<(4-(s.length%4));i++) { - hex += "0"; - } - } - hex += s; - for(var i = 0;i 4) { - result += hex.substring(hex.length-5,hex.length-1); - } else if(hex.length < 4) { - for(var j=0;j<=4-(hex.length%4);j++) { - result += "0"; - } - result += hex; - } - } - return result.split("undefined").join("").split("%").join(""); - } else { - //return new TextDecoder(en).decode(new TextEncoder(type).encode(value)); - return new TextDecoder(en).decode(new TextEncoder("utf8").encode(value)); - } - } - //function toString(en) { - //return toStringE(en,type); - //} - return { type: type, value: value, toString: toString }; - } -}; -var hexstrbase64 = { - strtobase64: function(s) { - return HexStrBase64Buffer.from(s, 'utf8').toString('base64'); - }, - base64tostr: function(b) { - return HexStrBase64Buffer.from(b, 'base64').toString('utf8'); - }, - strtohex: function(s) { - return HexStrBase64Buffer.from(s, 'utf8').toString('hex'); - }, - hextostr: function(h) { - return HexStrBase64Buffer.from(h, 'hex').toString('utf8'); - }, - hextobase64: function(h) { - return hexstrbase64.strtobase64(hexstrbase64.hextostr(h)); - }, - base64tohex: function(b) { - return hexstrbase64.strtohex(hexstrbase64.base64tostr(b)); - }, - cipher: function() { - this.strtobase64 = hexstrbase64.strtobase64; - this.base64tostr = hexstrbase64.base64tostr; - this.strtohex = hexstrbase64.strtohex; - this.hextostr = hexstrbase64.hextostr; - this.hextobase64 = hextobase64.hextobase64; - this.base64tohex = hextobase64.base64tohex; - }, - native: { - btoa: function(b) { - return hexstrbase64.strtobase64(b); - }, - atob: function(a) { - return hexstrbase64.base64tostr(a); - } - } -}; \ No newline at end of file diff --git a/hexstrbase64/index.js b/hexstrbase64/index.js deleted file mode 100644 index 4ec8879..0000000 --- a/hexstrbase64/index.js +++ /dev/null @@ -1,11 +0,0 @@ -let hexstrbase64 = require("./hexstrbase64/main.js"); -function decodeBase(b) { - return hexstrbase64.native.atob(b); -} -function encodeStr(s) { - return hexstrbase64.native.btoa(s); -} -var m = Object.create(hexstrbase64); -m.decodeBase = decodeBase; -m.encodeBase = encodeStr; -module.exports = m; \ No newline at end of file diff --git a/hexstrbase64/ok.png b/hexstrbase64/ok.png deleted file mode 100644 index 1293b27..0000000 Binary files a/hexstrbase64/ok.png and /dev/null differ diff --git a/hexstrbase64/readme.css b/hexstrbase64/readme.css deleted file mode 100644 index aa7c526..0000000 --- a/hexstrbase64/readme.css +++ /dev/null @@ -1,8 +0,0 @@ -.code { - border-width: 5px; - border-color: #BEBEBE; - border-style: solid; - color:black; - background-color: #7F7F7F; - font-family: Hack,Consolas,Monaco,monospace; -} \ No newline at end of file diff --git a/hexstrbase64/readme.html b/hexstrbase64/readme.html deleted file mode 100644 index 54a6a47..0000000 --- a/hexstrbase64/readme.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - HexStrBase64 Readme - - - -

hexstrbase64

-

How to install?

-

Node.js

-
    -
  1. Download library from here.
  2. -
  3. Modify index.js
  4. -
  5. Write header in program (replace ./hexstrbase64 with your path to hexstrbase64 library):
  6. -
    - var hexstrbase64 = require("./hexstrbase64/index.js");
    -
    -
  7. Now hexstrbase64 library added to program!
  8. -
-

Browser Javascript

-
    -
  1. Download library from here.
  2. -
  3. Write this code in <head> element (replace hexstrbase64/ with your path to hexstrbase64 library):
  4. -
    - <script src="hexstrbase64/hexstrbase64/base64_browser.js"></script>
    - <script src="hexstrbase64/hexstrbase64/main_browser.js"></script> -
    -
  5. Now hexstrbase64 library added to HTML!
  6. -
- - \ No newline at end of file diff --git a/hexstrbase64/test/base64.html b/hexstrbase64/test/base64.html deleted file mode 100644 index 18a02a0..0000000 --- a/hexstrbase64/test/base64.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - hexstrbase64 base64 test - - - - - - \ No newline at end of file diff --git a/hexstrbase64/test/base64.js b/hexstrbase64/test/base64.js deleted file mode 100644 index c425403..0000000 --- a/hexstrbase64/test/base64.js +++ /dev/null @@ -1,56 +0,0 @@ -function nameObj(n, v) { - return {name:n, value:v}; -} - -function testStart() { - document.write(''); - document.write('hexstrbase64 base64 test'); - console.log("TESTING STARTED"); - for (var i = 0; i < 3; i++) { - document.write('

' + enccases[i].name + '

'); - console.log("SWITCH " + enccases[i].name); - for (var j = 0; j < 2; j++) { - document.write('

' + enccases[i].value[j].name + '

'); - console.log("CASE " + enccases[i].value[j].name); - console.log("MUST BE: " + enccases[i].value[j].value); - console.log("IS : " + hexstrbase64.strtobase64(enccases[i].value[j].name)); - if (hexstrbase64.strtobase64(enccases[i].value[j].name) == enccases[i].value[j].value) { - document.write('

Equals

'); - console.log("EQUALS"); - } else { - document.write('

Not Equals

'); - console.log("NOT EQUALS"); - } - console.log("CASE " + enccases[i].value[j].name + " ENDED"); - } - console.log("SWITCH " + enccases[i].name + " ENDED"); - } - console.log("TESTING ENDED"); -} - -var enccases = [ - nameObj('Ascii', [ - nameObj('Hello world!', 'AEgAZQBsAGwAbwAgAHcAbwByAGwAZAAh'), - nameObj('Lorem ipsum', 'AEwAbwByAGUAbQAgAGkAcABzAHUAbQ==') - ]), - nameObj('Ascii More Than 64 Bytes', [ - nameObj( - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum fermentum ac nisl a sollicitudin. Cras interdum dui turpis, non scelerisque.', - 'AEwAbwByAGUAbQAgAGkAcABzAHUAbQAgAGQAbwBsAG8AcgAgAHMAaQB0ACAAYQBtAGUAdAAsACAAYwBvAG4AcwBlAGMAdABlAHQAdQByACAAYQBkAGkAcABpAHMAYwBpAG4AZwAgAGUAbABpAHQALgAgAFYAZQBzAHQAaQBiAHUAbAB1AG0AIABmAGUAcgBtAGUAbgB0AHUAbQAgAGEAYwAgAG4AaQBzAGwAIABhACAAcwBvAGwAbABpAGMAaQB0AHUAZABpAG4ALgAgAEMAcgBhAHMAIABpAG4AdABlAHIAZAB1AG0AIABkAHUAaQAgAHQAdQByAHAAaQBzACwAIABuAG8AbgAgAHMAYwBlAGwAZQByAGkAcwBxAHUAZQAu' - ), - nameObj( - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dapibus volutpat ligula at pulvinar. Etiam consequat mi fringilla facilisis eleifend.', - 'AEwAbwByAGUAbQAgAGkAcABzAHUAbQAgAGQAbwBsAG8AcgAgAHMAaQB0ACAAYQBtAGUAdAAsACAAYwBvAG4AcwBlAGMAdABlAHQAdQByACAAYQBkAGkAcABpAHMAYwBpAG4AZwAgAGUAbABpAHQALgAgAFAAaABhAHMAZQBsAGwAdQBzACAAZABhAHAAaQBiAHUAcwAgAHYAbwBsAHUAdABwAGEAdAAgAGwAaQBnAHUAbABhACAAYQB0ACAAcAB1AGwAdgBpAG4AYQByAC4AIABFAHQAaQBhAG0AIABjAG8AbgBzAGUAcQB1AGEAdAAgAG0AaQAgAGYAcgBpAG4AZwBpAGwAbABhACAAZgBhAGMAaQBsAGkAcwBpAHMAIABlAGwAZQBpAGYAZQBuAGQALg==' - ) - ]), - nameObj('Unicode UTF8', [ - nameObj( - 'DorianTech Hex String Base64转换器', - 'AEQAbwByAGkAYQBuAFQAZQBjAGgAIABIAGUAeAAgAFMAdAByAGkAbgBnACAAQgBhAHMAZQA2ADSPbGNiVmg=====' - ), - nameObj( - 'DorianTech Hex String Base64转换器,用于由DorianTech提供的Node.js', - 'AEQAbwByAGkAYQBuAFQAZQBjAGgAIABIAGUAeAAgAFMAdAByAGkAbgBnACAAQgBhAHMAZQA2ADSPbGNiVmj/DHUoTo51MQBEAG8AcgBpAGEAbgBUAGUAYwBoY9BPm3aEAE4AbwBkAGUALgBqAHM=====' - ) - ]) -]; \ No newline at end of file diff --git a/hexstrbase64/test/hex.html b/hexstrbase64/test/hex.html deleted file mode 100644 index 713dd6c..0000000 --- a/hexstrbase64/test/hex.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - hexstrbase64 hex test - - - - - - \ No newline at end of file diff --git a/hexstrbase64/test/hex.js b/hexstrbase64/test/hex.js deleted file mode 100644 index 8a57a8a..0000000 --- a/hexstrbase64/test/hex.js +++ /dev/null @@ -1,56 +0,0 @@ -function nameObj(n, v) { - return {name:n, value:v}; -} - -function testStart() { - document.write(''); - document.write('hexstrbase64 hex test'); - console.log("TESTING STARTED"); - for (var i = 0; i < 3; i++) { - document.write('

' + enccases[i].name + '

'); - console.log("SWITCH " + enccases[i].name); - for (var j = 0; j < 2; j++) { - document.write('

' + enccases[i].value[j].name + '

'); - console.log("CASE " + enccases[i].value[j].name); - console.log("MUST BE: " + enccases[i].value[j].value); - console.log("IS : " + hexstrbase64.strtohex(enccases[i].value[j].name)); - if (hexstrbase64.strtohex(enccases[i].value[j].name) == enccases[i].value[j].value) { - document.write('

Equals

'); - console.log("EQUALS"); - } else { - document.write('

Not Equals

'); - console.log("NOT EQUALS"); - } - console.log("CASE " + enccases[i].value[j].name + " ENDED"); - } - console.log("SWITCH " + enccases[i].name + " ENDED"); - } - console.log("TESTING ENDED"); -} - -var enccases = [ - nameObj('Ascii', [ - nameObj('Hello world!', '00480065006c006c006f00200077006f0072006c00640021'), - nameObj('Lorem ipsum', '004c006f00720065006d00200069007000730075006d') - ]), - nameObj('Ascii More Than 64 Bytes', [ - nameObj( - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum fermentum ac nisl a sollicitudin. Cras interdum dui turpis, non scelerisque.', - '004c006f00720065006d00200069007000730075006d00200064006f006c006f0072002000730069007400200061006d00650074002C00200063006f006e00730065006300740065007400750072002000610064006900700069007300630069006e006700200065006c00690074002e00200056006500730074006900620075006c0075006d0020006600650072006d0065006e00740075006d0020006100630020006e00690073006c0020006100200073006f006c006c0069006300690074007500640069006e002e0020004300720061007300200069006e00740065007200640075006d00200064007500690020007400750072007000690073002C0020006e006f006e0020007300630065006c0065007200690073007100750065002e' - ), - nameObj( - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dapibus volutpat ligula at pulvinar. Etiam consequat mi fringilla facilisis eleifend.', - '004c006f00720065006d00200069007000730075006d00200064006f006c006f0072002000730069007400200061006d00650074002C00200063006f006e00730065006300740065007400750072002000610064006900700069007300630069006e006700200065006c00690074002e002000500068006100730065006c006c007500730020006400610070006900620075007300200076006f006c007500740070006100740020006c006900670075006c0061002000610074002000700075006c00760069006e00610072002e00200045007400690061006d00200063006f006e0073006500710075006100740020006d00690020006600720069006e00670069006c006c006100200066006100630069006c006900730069007300200065006c0065006900660065006e0064002e' - ) - ]), - nameObj('Unicode UTF8', [ - nameObj( - 'DorianTech Hex String Base64转换器', - '0044006f007200690061006e0054006500630068002000480065007800200053007400720069006e006700200042006100730065003600348F6C63625668' - ), - nameObj( - 'DorianTech Hex String Base64转换器,用于由DorianTech提供的Node.js', - '0044006f007200690061006e0054006500630068002000480065007800200053007400720069006e006700200042006100730065003600348F6C63625668FF0C75284E8E75310044006f007200690061006e005400650063006863D04F9B7684004e006f00640065002e006a0073' - ) - ]) -]; \ No newline at end of file diff --git a/hexstrbase64/test/index.html b/hexstrbase64/test/index.html deleted file mode 100644 index b0ae622..0000000 --- a/hexstrbase64/test/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - hexstrbase64 test - - - - - - - \ No newline at end of file diff --git a/lib/hexstrbase64/fail.png b/lib/hexstrbase64/fail.png deleted file mode 100644 index bbebb5d..0000000 Binary files a/lib/hexstrbase64/fail.png and /dev/null differ diff --git a/lib/hexstrbase64/hexstrbase64/base64.js b/lib/hexstrbase64/hexstrbase64/base64.js deleted file mode 100644 index a995d36..0000000 --- a/lib/hexstrbase64/hexstrbase64/base64.js +++ /dev/null @@ -1,124 +0,0 @@ -//Base64.js for hexstrbase64 library for Node.js -/* - * Copyright (c) 2012 Miles Shang - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * Usage: - * Set your settings: - * base64.settings.char62 = "-"; - * base64.settings.char63 = "_"; - * etc. - * - * Then: - * base64.encode(str) takes a string and returns the base64 encoding of it. - * base64.decode(str) does the reverse. - */ - -/* TODO: - * Add a "padding_mandatory" flag to check for bad padding in the decoder. - * Add test cases that throw errors. - */ - -var base64 = new Object(); - -base64.settings = { // defaults - "char62" : "+", - "char63" : "/", - "pad" : "=", - "ascii" : false -}; - -/* - * Settings: - * If "pad" is not null or undefined, then it will be used for encoding. - * - * If "ascii" is set to true, then the encoder - * will assume that plaintext is in 8-bit chars (the standard). - * In this case, for every 3 chars in plaintext, you get 4 chars of base64. - * Any non-8-bit chars will cause an error. - * Otherwise, assume that all plaintext can be in the full range - * of Javascript chars, i.e. 16 bits. Get 8 chars of base64 for 3 chars - * of plaintext. Any possible JS string can be encoded. - */ - -base64.encode = function (str) { - this.char_set = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" - + this.settings.char62 + this.settings.char63; - - var output = ""; // final output - var buf = ""; // binary buffer - for (var i = 0; i < str.length; ++i) { - var c_num = str.charCodeAt(i); - if (this.settings.ascii) - if (c_num >= 256) - throw "Not an 8-bit char."; - var c_bin = c_num.toString(2); - while (c_bin.length < (this.settings.ascii ? 8 : 16)) - c_bin = "0" + c_bin; - buf += c_bin; - - while (buf.length >= 6) { - var sextet = buf.slice(0, 6); - buf = buf.slice(6); - output += this.char_set.charAt(parseInt(sextet, 2)); - } - } - - if (buf) { // not empty - while (buf.length < 6) buf += "0"; - output += this.char_set.charAt(parseInt(buf, 2)); - } - - if (this.settings.pad) - while (output.length % (this.settings.ascii ? 4 : 8) != 0) - output += this.settings.pad; - - return output; -} - -base64.decode = function (str) { - this.char_set = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" - + this.settings.char62 + this.settings.char63; - - var output = ""; // final output - var buf = ""; // binary buffer - var bits = (this.settings.ascii ? 8 : 16); - for (var i = 0; i < str.length; ++i) { - if (str[i] == this.settings.pad) break; - var c_num = this.char_set.indexOf(str.charAt(i)); - if (c_num == -1) throw "Not base64."; - var c_bin = c_num.toString(2); - while (c_bin.length < 6) c_bin = "0" + c_bin; - buf += c_bin; - - while (buf.length >= bits) { - var octet = buf.slice(0, bits); - buf = buf.slice(bits); - output += String.fromCharCode(parseInt(octet, 2)); - } - } - return output; -} -module.exports = base64; \ No newline at end of file diff --git a/lib/hexstrbase64/hexstrbase64/base64_browser.js b/lib/hexstrbase64/hexstrbase64/base64_browser.js deleted file mode 100644 index 44dec66..0000000 --- a/lib/hexstrbase64/hexstrbase64/base64_browser.js +++ /dev/null @@ -1,123 +0,0 @@ -//Base64.js for hexstrbase64 library for browser -/* - * Copyright (c) 2012 Miles Shang - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * Usage: - * Set your settings: - * base64.settings.char62 = "-"; - * base64.settings.char63 = "_"; - * etc. - * - * Then: - * base64.encode(str) takes a string and returns the base64 encoding of it. - * base64.decode(str) does the reverse. - */ - -/* TODO: - * Add a "padding_mandatory" flag to check for bad padding in the decoder. - * Add test cases that throw errors. - */ - -var base64 = new Object(); - -base64.settings = { // defaults - "char62" : "+", - "char63" : "/", - "pad" : "=", - "ascii" : false -}; - -/* - * Settings: - * If "pad" is not null or undefined, then it will be used for encoding. - * - * If "ascii" is set to true, then the encoder - * will assume that plaintext is in 8-bit chars (the standard). - * In this case, for every 3 chars in plaintext, you get 4 chars of base64. - * Any non-8-bit chars will cause an error. - * Otherwise, assume that all plaintext can be in the full range - * of Javascript chars, i.e. 16 bits. Get 8 chars of base64 for 3 chars - * of plaintext. Any possible JS string can be encoded. - */ - -base64.encode = function (str) { - this.char_set = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" - + this.settings.char62 + this.settings.char63; - - var output = ""; // final output - var buf = ""; // binary buffer - for (var i = 0; i < str.length; ++i) { - var c_num = str.charCodeAt(i); - if (this.settings.ascii) - if (c_num >= 256) - throw "Not an 8-bit char."; - var c_bin = c_num.toString(2); - while (c_bin.length < (this.settings.ascii ? 8 : 16)) - c_bin = "0" + c_bin; - buf += c_bin; - - while (buf.length >= 6) { - var sextet = buf.slice(0, 6); - buf = buf.slice(6); - output += this.char_set.charAt(parseInt(sextet, 2)); - } - } - - if (buf) { // not empty - while (buf.length < 6) buf += "0"; - output += this.char_set.charAt(parseInt(buf, 2)); - } - - if (this.settings.pad) - while (output.length % (this.settings.ascii ? 4 : 8) != 0) - output += this.settings.pad; - - return output; -} - -base64.decode = function (str) { - this.char_set = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" - + this.settings.char62 + this.settings.char63; - - var output = ""; // final output - var buf = ""; // binary buffer - var bits = (this.settings.ascii ? 8 : 16); - for (var i = 0; i < str.length; ++i) { - if (str[i] == this.settings.pad) break; - var c_num = this.char_set.indexOf(str.charAt(i)); - if (c_num == -1) throw "Not base64."; - var c_bin = c_num.toString(2); - while (c_bin.length < 6) c_bin = "0" + c_bin; - buf += c_bin; - - while (buf.length >= bits) { - var octet = buf.slice(0, bits); - buf = buf.slice(bits); - output += String.fromCharCode(parseInt(octet, 2)); - } - } - return output; -} \ No newline at end of file diff --git a/lib/hexstrbase64/hexstrbase64/main.js b/lib/hexstrbase64/hexstrbase64/main.js deleted file mode 100644 index 4f3d12d..0000000 --- a/lib/hexstrbase64/hexstrbase64/main.js +++ /dev/null @@ -1,129 +0,0 @@ -//Requires base64 -var base64 = require('./base64.js'); -var HexStrBase64Buffer = { - from: function(s, e) { - var type = e; - var value = ''; - if (e == 'base64') { - value = base64.decode(s); - } else if (e == 'hex') { - try { - var escaped = ""; - var hex = ""; - if(s.length%4 > 0) { - for(i=0;i<(4-(s.length%4));i++) { - hex += "0"; - } - } - hex += s; - for(var i = 0;i 4) { - result += hex.substring(hex.length-5,hex.length-1); - } else if(hex.length < 4) { - for(var j=0;j<=4-(hex.length%4);j++) { - result += "0"; - } - result += hex; - } - } - return result.split("undefined").join("").split("%").join(""); - } else { - //return Buffer.from(value, type).toString(en); - return Buffer.from(value,"utf8").toString(en); - } - } - //} - //function toString(en) { - //return toStringE(en,type); - //} - return { type: type, value: value, toString: toString }; - } -}; -var hexstrbase64 = { - strtobase64: function(s) { - return HexStrBase64Buffer.from(s, 'utf8').toString('base64'); - }, - base64tostr: function(b) { - return HexStrBase64Buffer.from(b, 'base64').toString('utf8'); - }, - strtohex: function(s) { - return HexStrBase64Buffer.from(s, 'utf8').toString('hex'); - }, - hextostr: function(h) { - return HexStrBase64Buffer.from(h, 'hex').toString('utf8'); - }, - hextobase64: function(h) { - return hexstrbase64.strtobase64(hexstrbase64.hextostr(h)); - }, - base64tohex: function(b) { - return hexstrbase64.strtohex(hexstrbase64.base64tostr(b)); - }, - cipher: function() { - this.strtobase64 = hexstrbase64.strtobase64; - this.base64tostr = hexstrbase64.base64tostr; - this.strtohex = hexstrbase64.strtohex; - this.hextostr = hexstrbase64.hextostr; - this.hextobase64 = hextobase64.hextobase64; - this.base64tohex = hextobase64.base64tohex; - }, - native: { - btoa: function(b) { - return hexstrbase64.strtobase64(b); - }, - atob: function(a) { - return hexstrbase64.base64tostr(a); - } - } -}; -module.exports = hexstrbase64; \ No newline at end of file diff --git a/lib/hexstrbase64/hexstrbase64/main_browser.js b/lib/hexstrbase64/hexstrbase64/main_browser.js deleted file mode 100644 index a2b4531..0000000 --- a/lib/hexstrbase64/hexstrbase64/main_browser.js +++ /dev/null @@ -1,126 +0,0 @@ -//Requires base64_browser.js -var HexStrBase64Buffer = { - from: function(s, e) { - var type = e; - var value = ''; - if (e == 'base64') { - value = base64.decode(s); - } else if (e == 'hex') { - try { - var escaped = ""; - var hex = ""; - if(s.length%4 > 0) { - for(i=0;i<(4-(s.length%4));i++) { - hex += "0"; - } - } - hex += s; - for(var i = 0;i 4) { - result += hex.substring(hex.length-5,hex.length-1); - } else if(hex.length < 4) { - for(var j=0;j<=4-(hex.length%4);j++) { - result += "0"; - } - result += hex; - } - } - return result.split("undefined").join("").split("%").join(""); - } else { - //return new TextDecoder(en).decode(new TextEncoder(type).encode(value)); - return new TextDecoder(en).decode(new TextEncoder("utf8").encode(value)); - } - } - //function toString(en) { - //return toStringE(en,type); - //} - return { type: type, value: value, toString: toString }; - } -}; -var hexstrbase64 = { - strtobase64: function(s) { - return HexStrBase64Buffer.from(s, 'utf8').toString('base64'); - }, - base64tostr: function(b) { - return HexStrBase64Buffer.from(b, 'base64').toString('utf8'); - }, - strtohex: function(s) { - return HexStrBase64Buffer.from(s, 'utf8').toString('hex'); - }, - hextostr: function(h) { - return HexStrBase64Buffer.from(h, 'hex').toString('utf8'); - }, - hextobase64: function(h) { - return hexstrbase64.strtobase64(hexstrbase64.hextostr(h)); - }, - base64tohex: function(b) { - return hexstrbase64.strtohex(hexstrbase64.base64tostr(b)); - }, - cipher: function() { - this.strtobase64 = hexstrbase64.strtobase64; - this.base64tostr = hexstrbase64.base64tostr; - this.strtohex = hexstrbase64.strtohex; - this.hextostr = hexstrbase64.hextostr; - this.hextobase64 = hextobase64.hextobase64; - this.base64tohex = hextobase64.base64tohex; - }, - native: { - btoa: function(b) { - return hexstrbase64.strtobase64(b); - }, - atob: function(a) { - return hexstrbase64.base64tostr(a); - } - } -}; \ No newline at end of file diff --git a/lib/hexstrbase64/index.js b/lib/hexstrbase64/index.js deleted file mode 100644 index 4ec8879..0000000 --- a/lib/hexstrbase64/index.js +++ /dev/null @@ -1,11 +0,0 @@ -let hexstrbase64 = require("./hexstrbase64/main.js"); -function decodeBase(b) { - return hexstrbase64.native.atob(b); -} -function encodeStr(s) { - return hexstrbase64.native.btoa(s); -} -var m = Object.create(hexstrbase64); -m.decodeBase = decodeBase; -m.encodeBase = encodeStr; -module.exports = m; \ No newline at end of file diff --git a/lib/hexstrbase64/ok.png b/lib/hexstrbase64/ok.png deleted file mode 100644 index 1293b27..0000000 Binary files a/lib/hexstrbase64/ok.png and /dev/null differ diff --git a/lib/hexstrbase64/readme.css b/lib/hexstrbase64/readme.css deleted file mode 100644 index aa7c526..0000000 --- a/lib/hexstrbase64/readme.css +++ /dev/null @@ -1,8 +0,0 @@ -.code { - border-width: 5px; - border-color: #BEBEBE; - border-style: solid; - color:black; - background-color: #7F7F7F; - font-family: Hack,Consolas,Monaco,monospace; -} \ No newline at end of file diff --git a/lib/hexstrbase64/readme.html b/lib/hexstrbase64/readme.html deleted file mode 100644 index 54a6a47..0000000 --- a/lib/hexstrbase64/readme.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - HexStrBase64 Readme - - - -

hexstrbase64

-

How to install?

-

Node.js

-
    -
  1. Download library from here.
  2. -
  3. Modify index.js
  4. -
  5. Write header in program (replace ./hexstrbase64 with your path to hexstrbase64 library):
  6. -
    - var hexstrbase64 = require("./hexstrbase64/index.js");
    -
    -
  7. Now hexstrbase64 library added to program!
  8. -
-

Browser Javascript

-
    -
  1. Download library from here.
  2. -
  3. Write this code in <head> element (replace hexstrbase64/ with your path to hexstrbase64 library):
  4. -
    - <script src="hexstrbase64/hexstrbase64/base64_browser.js"></script>
    - <script src="hexstrbase64/hexstrbase64/main_browser.js"></script> -
    -
  5. Now hexstrbase64 library added to HTML!
  6. -
- - \ No newline at end of file diff --git a/lib/hexstrbase64/test/base64.html b/lib/hexstrbase64/test/base64.html deleted file mode 100644 index 18a02a0..0000000 --- a/lib/hexstrbase64/test/base64.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - hexstrbase64 base64 test - - - - - - \ No newline at end of file diff --git a/lib/hexstrbase64/test/base64.js b/lib/hexstrbase64/test/base64.js deleted file mode 100644 index c425403..0000000 --- a/lib/hexstrbase64/test/base64.js +++ /dev/null @@ -1,56 +0,0 @@ -function nameObj(n, v) { - return {name:n, value:v}; -} - -function testStart() { - document.write(''); - document.write('hexstrbase64 base64 test'); - console.log("TESTING STARTED"); - for (var i = 0; i < 3; i++) { - document.write('

' + enccases[i].name + '

'); - console.log("SWITCH " + enccases[i].name); - for (var j = 0; j < 2; j++) { - document.write('

' + enccases[i].value[j].name + '

'); - console.log("CASE " + enccases[i].value[j].name); - console.log("MUST BE: " + enccases[i].value[j].value); - console.log("IS : " + hexstrbase64.strtobase64(enccases[i].value[j].name)); - if (hexstrbase64.strtobase64(enccases[i].value[j].name) == enccases[i].value[j].value) { - document.write('

Equals

'); - console.log("EQUALS"); - } else { - document.write('

Not Equals

'); - console.log("NOT EQUALS"); - } - console.log("CASE " + enccases[i].value[j].name + " ENDED"); - } - console.log("SWITCH " + enccases[i].name + " ENDED"); - } - console.log("TESTING ENDED"); -} - -var enccases = [ - nameObj('Ascii', [ - nameObj('Hello world!', 'AEgAZQBsAGwAbwAgAHcAbwByAGwAZAAh'), - nameObj('Lorem ipsum', 'AEwAbwByAGUAbQAgAGkAcABzAHUAbQ==') - ]), - nameObj('Ascii More Than 64 Bytes', [ - nameObj( - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum fermentum ac nisl a sollicitudin. Cras interdum dui turpis, non scelerisque.', - 'AEwAbwByAGUAbQAgAGkAcABzAHUAbQAgAGQAbwBsAG8AcgAgAHMAaQB0ACAAYQBtAGUAdAAsACAAYwBvAG4AcwBlAGMAdABlAHQAdQByACAAYQBkAGkAcABpAHMAYwBpAG4AZwAgAGUAbABpAHQALgAgAFYAZQBzAHQAaQBiAHUAbAB1AG0AIABmAGUAcgBtAGUAbgB0AHUAbQAgAGEAYwAgAG4AaQBzAGwAIABhACAAcwBvAGwAbABpAGMAaQB0AHUAZABpAG4ALgAgAEMAcgBhAHMAIABpAG4AdABlAHIAZAB1AG0AIABkAHUAaQAgAHQAdQByAHAAaQBzACwAIABuAG8AbgAgAHMAYwBlAGwAZQByAGkAcwBxAHUAZQAu' - ), - nameObj( - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dapibus volutpat ligula at pulvinar. Etiam consequat mi fringilla facilisis eleifend.', - 'AEwAbwByAGUAbQAgAGkAcABzAHUAbQAgAGQAbwBsAG8AcgAgAHMAaQB0ACAAYQBtAGUAdAAsACAAYwBvAG4AcwBlAGMAdABlAHQAdQByACAAYQBkAGkAcABpAHMAYwBpAG4AZwAgAGUAbABpAHQALgAgAFAAaABhAHMAZQBsAGwAdQBzACAAZABhAHAAaQBiAHUAcwAgAHYAbwBsAHUAdABwAGEAdAAgAGwAaQBnAHUAbABhACAAYQB0ACAAcAB1AGwAdgBpAG4AYQByAC4AIABFAHQAaQBhAG0AIABjAG8AbgBzAGUAcQB1AGEAdAAgAG0AaQAgAGYAcgBpAG4AZwBpAGwAbABhACAAZgBhAGMAaQBsAGkAcwBpAHMAIABlAGwAZQBpAGYAZQBuAGQALg==' - ) - ]), - nameObj('Unicode UTF8', [ - nameObj( - 'DorianTech Hex String Base64转换器', - 'AEQAbwByAGkAYQBuAFQAZQBjAGgAIABIAGUAeAAgAFMAdAByAGkAbgBnACAAQgBhAHMAZQA2ADSPbGNiVmg=====' - ), - nameObj( - 'DorianTech Hex String Base64转换器,用于由DorianTech提供的Node.js', - 'AEQAbwByAGkAYQBuAFQAZQBjAGgAIABIAGUAeAAgAFMAdAByAGkAbgBnACAAQgBhAHMAZQA2ADSPbGNiVmj/DHUoTo51MQBEAG8AcgBpAGEAbgBUAGUAYwBoY9BPm3aEAE4AbwBkAGUALgBqAHM=====' - ) - ]) -]; \ No newline at end of file diff --git a/lib/hexstrbase64/test/hex.html b/lib/hexstrbase64/test/hex.html deleted file mode 100644 index 713dd6c..0000000 --- a/lib/hexstrbase64/test/hex.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - hexstrbase64 hex test - - - - - - \ No newline at end of file diff --git a/lib/hexstrbase64/test/hex.js b/lib/hexstrbase64/test/hex.js deleted file mode 100644 index 8a57a8a..0000000 --- a/lib/hexstrbase64/test/hex.js +++ /dev/null @@ -1,56 +0,0 @@ -function nameObj(n, v) { - return {name:n, value:v}; -} - -function testStart() { - document.write(''); - document.write('hexstrbase64 hex test'); - console.log("TESTING STARTED"); - for (var i = 0; i < 3; i++) { - document.write('

' + enccases[i].name + '

'); - console.log("SWITCH " + enccases[i].name); - for (var j = 0; j < 2; j++) { - document.write('

' + enccases[i].value[j].name + '

'); - console.log("CASE " + enccases[i].value[j].name); - console.log("MUST BE: " + enccases[i].value[j].value); - console.log("IS : " + hexstrbase64.strtohex(enccases[i].value[j].name)); - if (hexstrbase64.strtohex(enccases[i].value[j].name) == enccases[i].value[j].value) { - document.write('

Equals

'); - console.log("EQUALS"); - } else { - document.write('

Not Equals

'); - console.log("NOT EQUALS"); - } - console.log("CASE " + enccases[i].value[j].name + " ENDED"); - } - console.log("SWITCH " + enccases[i].name + " ENDED"); - } - console.log("TESTING ENDED"); -} - -var enccases = [ - nameObj('Ascii', [ - nameObj('Hello world!', '00480065006c006c006f00200077006f0072006c00640021'), - nameObj('Lorem ipsum', '004c006f00720065006d00200069007000730075006d') - ]), - nameObj('Ascii More Than 64 Bytes', [ - nameObj( - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum fermentum ac nisl a sollicitudin. Cras interdum dui turpis, non scelerisque.', - '004c006f00720065006d00200069007000730075006d00200064006f006c006f0072002000730069007400200061006d00650074002C00200063006f006e00730065006300740065007400750072002000610064006900700069007300630069006e006700200065006c00690074002e00200056006500730074006900620075006c0075006d0020006600650072006d0065006e00740075006d0020006100630020006e00690073006c0020006100200073006f006c006c0069006300690074007500640069006e002e0020004300720061007300200069006e00740065007200640075006d00200064007500690020007400750072007000690073002C0020006e006f006e0020007300630065006c0065007200690073007100750065002e' - ), - nameObj( - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dapibus volutpat ligula at pulvinar. Etiam consequat mi fringilla facilisis eleifend.', - '004c006f00720065006d00200069007000730075006d00200064006f006c006f0072002000730069007400200061006d00650074002C00200063006f006e00730065006300740065007400750072002000610064006900700069007300630069006e006700200065006c00690074002e002000500068006100730065006c006c007500730020006400610070006900620075007300200076006f006c007500740070006100740020006c006900670075006c0061002000610074002000700075006c00760069006e00610072002e00200045007400690061006d00200063006f006e0073006500710075006100740020006d00690020006600720069006e00670069006c006c006100200066006100630069006c006900730069007300200065006c0065006900660065006e0064002e' - ) - ]), - nameObj('Unicode UTF8', [ - nameObj( - 'DorianTech Hex String Base64转换器', - '0044006f007200690061006e0054006500630068002000480065007800200053007400720069006e006700200042006100730065003600348F6C63625668' - ), - nameObj( - 'DorianTech Hex String Base64转换器,用于由DorianTech提供的Node.js', - '0044006f007200690061006e0054006500630068002000480065007800200053007400720069006e006700200042006100730065003600348F6C63625668FF0C75284E8E75310044006f007200690061006e005400650063006863D04F9B7684004e006f00640065002e006a0073' - ) - ]) -]; \ No newline at end of file diff --git a/lib/hexstrbase64/test/index.html b/lib/hexstrbase64/test/index.html deleted file mode 100644 index b0ae622..0000000 --- a/lib/hexstrbase64/test/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - hexstrbase64 test - - - - - - - \ No newline at end of file