From 2b8c1e71945cf08189a0461b67e743931a42e327 Mon Sep 17 00:00:00 2001 From: Vijay Sarvepalli Date: Thu, 9 Jul 2026 16:05:54 -0400 Subject: [PATCH 1/2] Updates to fix zoomcontrol Issue #1124 --- docs/ssvc-calc/findex.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/ssvc-calc/findex.html b/docs/ssvc-calc/findex.html index c71740d20..b0b06f8ba 100644 --- a/docs/ssvc-calc/findex.html +++ b/docs/ssvc-calc/findex.html @@ -144,7 +144,8 @@

-
+
🔍
Date: Thu, 9 Jul 2026 16:40:12 -0400 Subject: [PATCH 2/2] Update to safedivname resolve collision in names --- docs/ssvc-calc/ssvc.js | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/ssvc-calc/ssvc.js b/docs/ssvc-calc/ssvc.js index a0ef8ed39..a5f8c1955 100644 --- a/docs/ssvc-calc/ssvc.js +++ b/docs/ssvc-calc/ssvc.js @@ -1404,13 +1404,23 @@ function shwhelp(w) { function safedivname(instr) { - var uri_esc = encodeURIComponent(instr) - var safestr = btoa(uri_esc.replace(/%([0-9A-F]{2})/g, - (m, p) => - String.fromCharCode('0x' + p))); - var fstr = "d-"+safestr.replace(/[\+\/\=]/gi, - (m,p) => { return m.charCodeAt(0) }); - return fstr.substr(0,14); + const uriEsc = encodeURIComponent(instr); + const base64 = btoa( + uriEsc.replace(/%([0-9A-F]{2})/g, (_, p) => + String.fromCharCode(parseInt(p, 16)) + ) + ) + .replace(/\+/g, "-") + .replace(/\//g, "_") + .replace(/=+$/g, ""); + let h = 0x811c9dc5; + for (let i = 0; i < instr.length; i++) { + h ^= instr.charCodeAt(i); + h = Math.imul(h, 0x01000193); + } + const hash = (h >>> 0).toString(36); + const prefix = base64.slice(0, 24); + return "d-" + prefix + "-" + hash; }