Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/ssvc-calc/findex.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ <h4 class="cover-heading">
</table>
</p>
<section id="evaluate_section"></section>
<div id="zoomcontrol" class="graphy embedded d-none">
<div id="zoomcontrol" class="graphy embedded d-none"
style="z-index:100">
<div class="d-none">&#128269;</div>
<input type="range" orient="vertical" alt="Zoom Graph"
max="100" min="0" value="100" title="Zoom Graph"
Expand Down
24 changes: 17 additions & 7 deletions docs/ssvc-calc/ssvc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


Expand Down
Loading