From 0db9f8e8715a21b3b43d25da52530e1e1d6edb58 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Fri, 11 Oct 2024 12:54:19 +0200 Subject: [PATCH] trolled once again --- src/calculator/index.html | 19 ++++++++++++++ src/calculator/script.js | 32 +++++++++++++++++++++++ src/index.html | 9 +++++-- src/port-calc.html | 55 --------------------------------------- src/services.html | 18 +++---------- 5 files changed, 62 insertions(+), 71 deletions(-) create mode 100644 src/calculator/index.html create mode 100644 src/calculator/script.js delete mode 100644 src/port-calc.html diff --git a/src/calculator/index.html b/src/calculator/index.html new file mode 100644 index 0000000..6eaa8f3 --- /dev/null +++ b/src/calculator/index.html @@ -0,0 +1,19 @@ + + + + +dn724 + + + + + + +

Port:

+ + \ No newline at end of file diff --git a/src/calculator/script.js b/src/calculator/script.js new file mode 100644 index 0000000..8f47950 --- /dev/null +++ b/src/calculator/script.js @@ -0,0 +1,32 @@ +const result = document.getElementById('result'); +const isNumber = (s) => /^\d+$/.test(s); + +function calculate(el) { + if (el.value == '') { + result.innerText = ''; + return; + } + + let cand = cyrb53(el.value).toString().slice(0, 5); + + if (cand > 65535 || cand < 30000) { + cand = (cand % 3 + 3) * 10000 + (cand % 10000); + } + + result.innerText = cand; +} + +const cyrb53 = (str, seed = 0) => { + let h1 = 0xdeadbeef ^ seed, h2 = 0x41c6ce57 ^ seed; + for (let i = 0, ch; i < str.length; i++) { + ch = str.charCodeAt(i); + h1 = Math.imul(h1 ^ ch, 2654435761); + h2 = Math.imul(h2 ^ ch, 1597334677); + } + h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507); + h1 ^= Math.imul(h2 ^ (h2 >>> 13), 3266489909); + h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507); + h2 ^= Math.imul(h1 ^ (h1 >>> 13), 3266489909); + + return 4294967296 * (2097151 & h2) + (h1 >>> 0); +}; \ No newline at end of file diff --git a/src/index.html b/src/index.html index bd4f50b..d485c99 100644 --- a/src/index.html +++ b/src/index.html @@ -44,7 +44,6 @@
  • Rome. Italy
  • Nuremberg, Germany
  • Netherlands, Amsterdam
  • -
  • Network map (uses thunderforest.com API)
  • Peering requirements

    @@ -60,7 +59,7 @@

    Contact

    @@ -71,4 +70,10 @@
  • Session: 05293535c0f0b5ae76a663f3f875582590edd77abd72ab9b12f3acbe4bb078aa49
  • +

    Other

    + + \ No newline at end of file diff --git a/src/port-calc.html b/src/port-calc.html deleted file mode 100644 index 4720db4..0000000 --- a/src/port-calc.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - -dn724 - - - - -

    Port:

    - - - - \ No newline at end of file diff --git a/src/services.html b/src/services.html index 0d6427b..8d5933e 100644 --- a/src/services.html +++ b/src/services.html @@ -42,22 +42,12 @@ Description - Minetest - nodecode.pivipi.dn42
    + None yet + m724.dn42
    - - - - Minecraft - fd11:ef8b:72ac::
    - -