From faa043cb996cd138cff47f9022e861318b165863 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Fri, 8 Sep 2023 20:20:40 +0200 Subject: [PATCH] Update to SVR.JS 3.9.4 --- hexstrbase64/fail.png | Bin 243 -> 0 bytes hexstrbase64/hexstrbase64/base64.js | 124 ----------------- hexstrbase64/hexstrbase64/base64_browser.js | 123 ----------------- hexstrbase64/hexstrbase64/main.js | 129 ------------------ hexstrbase64/hexstrbase64/main_browser.js | 126 ----------------- hexstrbase64/index.js | 11 -- hexstrbase64/ok.png | Bin 252 -> 0 bytes hexstrbase64/readme.css | 8 -- hexstrbase64/readme.html | 31 ----- hexstrbase64/test/base64.html | 13 -- hexstrbase64/test/base64.js | 56 -------- hexstrbase64/test/hex.html | 13 -- hexstrbase64/test/hex.js | 56 -------- hexstrbase64/test/index.html | 16 --- index.html | 11 +- lib/hexstrbase64/fail.png | Bin 243 -> 0 bytes lib/hexstrbase64/hexstrbase64/base64.js | 124 ----------------- .../hexstrbase64/base64_browser.js | 123 ----------------- lib/hexstrbase64/hexstrbase64/main.js | 129 ------------------ lib/hexstrbase64/hexstrbase64/main_browser.js | 126 ----------------- lib/hexstrbase64/index.js | 11 -- lib/hexstrbase64/ok.png | Bin 252 -> 0 bytes lib/hexstrbase64/readme.css | 8 -- lib/hexstrbase64/readme.html | 31 ----- lib/hexstrbase64/test/base64.html | 13 -- lib/hexstrbase64/test/base64.js | 56 -------- lib/hexstrbase64/test/hex.html | 13 -- lib/hexstrbase64/test/hex.js | 56 -------- lib/hexstrbase64/test/index.html | 16 --- licenses/index.html | 8 +- mods/primitiveanalytics.tar.gz | Bin 1175 -> 0 bytes svr.js | 48 ++++--- tests.html | 4 +- 33 files changed, 40 insertions(+), 1443 deletions(-) delete mode 100644 hexstrbase64/fail.png delete mode 100644 hexstrbase64/hexstrbase64/base64.js delete mode 100644 hexstrbase64/hexstrbase64/base64_browser.js delete mode 100644 hexstrbase64/hexstrbase64/main.js delete mode 100644 hexstrbase64/hexstrbase64/main_browser.js delete mode 100644 hexstrbase64/index.js delete mode 100644 hexstrbase64/ok.png delete mode 100644 hexstrbase64/readme.css delete mode 100644 hexstrbase64/readme.html delete mode 100644 hexstrbase64/test/base64.html delete mode 100644 hexstrbase64/test/base64.js delete mode 100644 hexstrbase64/test/hex.html delete mode 100644 hexstrbase64/test/hex.js delete mode 100644 hexstrbase64/test/index.html delete mode 100644 lib/hexstrbase64/fail.png delete mode 100644 lib/hexstrbase64/hexstrbase64/base64.js delete mode 100644 lib/hexstrbase64/hexstrbase64/base64_browser.js delete mode 100644 lib/hexstrbase64/hexstrbase64/main.js delete mode 100644 lib/hexstrbase64/hexstrbase64/main_browser.js delete mode 100644 lib/hexstrbase64/index.js delete mode 100644 lib/hexstrbase64/ok.png delete mode 100644 lib/hexstrbase64/readme.css delete mode 100644 lib/hexstrbase64/readme.html delete mode 100644 lib/hexstrbase64/test/base64.html delete mode 100644 lib/hexstrbase64/test/base64.js delete mode 100644 lib/hexstrbase64/test/hex.html delete mode 100644 lib/hexstrbase64/test/hex.js delete mode 100644 lib/hexstrbase64/test/index.html delete mode 100644 mods/primitiveanalytics.tar.gz diff --git a/hexstrbase64/fail.png b/hexstrbase64/fail.png deleted file mode 100644 index bbebb5d51d6fef7b2c11b04f96e93f9228834c30..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 243 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1SFYWcSQjymUKs7M+SzC{oH>NS%G}c0*}aI z1_r*vAk26?e?9 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 1293b272bc7cea83026d363415f1d94b4124cb88..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 252 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1SFYWcSQjy#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=DjSL74G){)!Z!;6zUs#}EtuqZ7{ZHYo78aWAeYkc>U9IpaMwGc|o`R%!&GqXG_-9aTc80 z9iQ4^tn8T{w)#-AcuizbTHc#} - - - 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/index.html b/index.html index a027b08..b1e6765 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@ - SVR.JS 3.9.3 + SVR.JS 3.9.4 -

Welcome to SVR.JS 3.9.3

+

Welcome to SVR.JS 3.9.4



@@ -117,11 +117,14 @@

Changes:

    -
  • Mitigated security vulnerability: SVR.JS mods and server-side JavaScript not using href or uobject.pathname in some path checks are no longer vulnerable to access control bypass (from SVR.JS configuration).
  • +
  • Changed warning about no support for HTTP/2.
  • +
  • Added "svrmodpack" deprecation warning.
  • +
  • Removed unmaintained primitive analytics mod.
  • +
  • Removed unmaintained and undocumented hexstrbase64 library.
  • +
  • Added TypeError workaround for Bun 1.0.0

Bugs:

    -
  • Some very old mods requiring hexstrbase64 will fail to load.
  • On first load server-side JavaScript will fail to load when SVR.JS is running on Bun.

diff --git a/lib/hexstrbase64/fail.png b/lib/hexstrbase64/fail.png deleted file mode 100644 index bbebb5d51d6fef7b2c11b04f96e93f9228834c30..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 243 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1SFYWcSQjymUKs7M+SzC{oH>NS%G}c0*}aI z1_r*vAk26?e?9 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 1293b272bc7cea83026d363415f1d94b4124cb88..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 252 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1SFYWcSQjy#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=DjSL74G){)!Z!;6zUs#}EtuqZ7{ZHYo78aWAeYkc>U9IpaMwGc|o`R%!&GqXG_-9aTc80 z9iQ4^tn8T{w)#-AcuizbTHc#} - - - 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 diff --git a/licenses/index.html b/licenses/index.html index 517c63b..bfbb553 100644 --- a/licenses/index.html +++ b/licenses/index.html @@ -1,7 +1,7 @@ - SVR.JS 3.9.3 Licenses + SVR.JS 3.9.4 Licenses -

SVR.JS 3.9.3 Licenses

-

SVR.JS 3.9.3

+

SVR.JS 3.9.4 Licenses

+

SVR.JS 3.9.4

MIT License

@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-

Packages used by SVR.JS 3.9.3 and utilities

+

Packages used by SVR.JS 3.9.4 and utilities

License: MIT
diff --git a/mods/primitiveanalytics.tar.gz b/mods/primitiveanalytics.tar.gz deleted file mode 100644 index af6c34f55f5c6f1725425acf00d711ba5ad56bbf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1175 zcmV;I1ZevoiwFSnDnVZW1MOE`Z`(E$&2xbMhYLO=65>d*oh(EAF?4B%uE4q>+4hp; zL6#|toh+&(727EM-*+fmt)0eph9L=t=_Iga-b>yOo_k4&Y{;kHN4@ui2!OM*v+^6b z|9yHAwDy|qvsTb*owiTgdqK0=YPa_&cuJ=#6xxJ}XirILw(0GX|3`6$;A2faQv6dP z6n9vxncI1_Zv}EqAQytT$RZg0WbP-e3Lt0e-*QCqQvisO+nw&KHS=h{=H$ z)awyT%s6FqaDa4qd@8ijSFMrFeNM#-ndqV#tQtr5})tV?_xc$A* zyc2w)Ju@||K~5ej&412}13iVH9#X?9N7QsZBd?4S*$B&a)_wnXuD-#xM@Fid<9-|W zx;mbiFUnq0=E;TAc^XFC@o(_wj~dK}zt0r5rBAtMeqyJwwLQHLqh{O03z96oeg~JF zRuD9ZUGhlqJ3gcfnHip0?{}r{lEW_3bCyHEpf3 zv5k7nwMK>?FN73m_1FccSQI)f3LNP$d7i%fbu4SY+YEIcf-WI(% zTAhg!+cvhc&ce3X$aXC3Ihv)jLW2m$k{rLQWIZZSTd~NHr61_}mdOlc86y;Vvo zu%@#APm032)bHAf{jL!v<$c(o2Q75{g+kX~s1M|DhN;bMGa&8e{nyKaq9h!G2Yedw z+<*vt%A?#KS|0t#Q#rvAY3#8pV=@URZr328NhflWom1D(``t(mdEfSJH0n}&rBADy z41JndccA?KS_j`Wt{xtza`+${=)A-1=CiI}8b&a`r5s!-OFfJXO@v8sqTj)P(8v#m zW0B#AQ6Y|Vj1qHB8AuqWog3C) zu$$P^vAaVb5MWh8xC`0-wrat(#FuLmB@m>U{6^R zyZiBD`j*9d-v)o~_w6_osjeD!HhNsco^KW{E?*nw&dbZ&<{r9wwc8Zh(l);EKbFJ7 z#x>2QGPdF3+KOo}eFJ}4ASs^6V)>LdcD(-u&GvWI`(OL) pYpX_$8Z~Ovs8ORvjT$v-)TmLTMvWRZYSefs{0-u5YWx5w008pTT7dun diff --git a/svr.js b/svr.js index b8adcf8..44bd86f 100644 --- a/svr.js +++ b/svr.js @@ -81,7 +81,7 @@ function deleteFolderRecursive(path) { } var os = require("os"); -var version = "3.9.3"; +var version = "3.9.4"; var singlethreaded = false; if (process.versions) process.versions.svrjs = version; // Inject SVR.JS into process.versions @@ -223,28 +223,31 @@ if (!singlethreaded) { function checkSendImplementation(worker) { var sendImplemented = true; - if (!worker.send) { - sendImplemented = false; - } - - var oldLog = console.log; - console.log = function (a,b,c,d,e,f) { - if(a == "ChildProcess.prototype.send() - Sorry! Not implemented yet") { - throw new Error("NOT IMPLEMENTED"); - } else { - oldLog(a,b,c,d,e,f); - } - }; - - try { - worker.send(undefined); - } catch (err) { - if (err.message === "NOT IMPLEMENTED") { + if (!(process.versions && process.versions.bun && process.versions.bun[0] != "0")) { + if (!worker.send) { sendImplemented = false; } - } - console.log = oldLog; + var oldLog = console.log; + console.log = function (a,b,c,d,e,f) { + if(a == "ChildProcess.prototype.send() - Sorry! Not implemented yet") { + throw new Error("NOT IMPLEMENTED"); + } else { + oldLog(a,b,c,d,e,f); + } + }; + + try { + worker.send(undefined); + } catch (err) { + if (err.message === "NOT IMPLEMENTED") { + sendImplemented = false; + } + console.log(err); + } + + console.log = oldLog; + } return sendImplemented; } @@ -1423,6 +1426,7 @@ process.exit = function (code) { var modLoadingErrors = []; var SSJSError = undefined; +var svrmodpackUsed = false; // Load mods if the `disableMods` flag is not set if (!disableMods) { @@ -1487,6 +1491,7 @@ if (!disableMods) { // If it's not a ".tar.gz" file, unpack it using `svrmodpack` if (svrmodpack._errored) throw svrmodpack._errored; svrmodpack.unpack(modFile, __dirname + "/temp/" + modloaderFolderName + "/" + modFileRaw); + svrmodpackUsed = true; } // Initialize variables for mod loading @@ -4801,7 +4806,7 @@ function start(init) { console.log("Welcome to DorianTech SVR.JS server."); // Print warnings if (version.indexOf("Nightly-") === 0) serverconsole.locwarnmessage("This version is only for test purposes and may be unstable."); - if (http2.__disabled__ !== undefined) serverconsole.locwarnmessage("HTTP/2 isn't supported by your Node.JS version! You may not be able to use HTTP/2 with SVR.JS"); + if (svrmodpackUsed) serverconsole.locwarnmessage("The \"svrmodpack\" library is deprecated. Mods using svrmodpack format may not work in future SVR.JS versions."); if (configJSON.enableHTTP2 && !secure) serverconsole.locwarnmessage("HTTP/2 without HTTPS may not work in web browsers. Web browsers only support HTTP/2 with HTTPS!"); if (process.isBun) { serverconsole.locwarnmessage("Bun support is experimental. Some features of SVR.JS, SVR.JS mods and SVR.JS server-side JavaScript may not work as expected."); @@ -4850,6 +4855,7 @@ function start(init) { if (configJSONRErr) throw new Error("Can't read SVR.JS configuration file: " + configJSONRErr.message); if (configJSONPErr) throw new Error("SVR.JS configuration parse error: " + configJSONPErr.message); if (configJSON.enableHTTP2 && !secure && (typeof port != "number")) throw new Error("HTTP/2 without HTTPS, along with Unix sockets/Windows named pipes aren't supported by SVR.JS."); + if (configJSON.enableHTTP2 && http2.__disabled__ !== undefined) throw new Error("HTTP/2 isn't supported by your Node.JS version! You may not be able to use HTTP/2 with SVR.JS"); if (listenAddress) { if (listenAddress.match(/^[0-9]+$/)) throw new Error("Listening network address can't be numeric (it need to be either valid IP address, or valid domain name)."); if (listenAddress.match(/^(?:2(?:2[4-9]|3[0-9])\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$|ff[0-9a-f][0-9a-f]:[0-9a-f:])/i)) throw new Error("SVR.JS can't listen on multicast address."); diff --git a/tests.html b/tests.html index 7d49654..edbd068 100644 --- a/tests.html +++ b/tests.html @@ -1,7 +1,7 @@ - SVR.JS 3.9.3 Tests + SVR.JS 3.9.4 Tests -

SVR.JS 3.9.3 Tests

+

SVR.JS 3.9.4 Tests

Directory

Directory (with query)