This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
proto [2025/10/12 03:35] – created Yuki | proto [2025/10/12 04:24] (current) – Yuki | ||
---|---|---|---|
Line 16: | Line 16: | ||
< | < | ||
function rot(){ | function rot(){ | ||
- | navigator.registerProtocolHandler(" | + | |
} | } | ||
function base(){ | function base(){ | ||
- | navigator.registerProtocolHandler(" | + | |
+ | } | ||
+ | function caesar(str, shift, decrypt = false) { | ||
+ | const s = decrypt ? (26 - shift) % 26 : shift; | ||
+ | const n = s > 0 ? s : 26 + (s % 26); | ||
+ | return [...str] | ||
+ | .map((l, i) => { | ||
+ | const c = str.charCodeAt(i); | ||
+ | if (c >= 65 && c <= 90) | ||
+ | return String.fromCharCode(((c - 65 + n) % 26) + 65); | ||
+ | if (c >= 97 && c <= 122) | ||
+ | return String.fromCharCode(((c - 97 + n) % 26) + 97); | ||
+ | return l; | ||
+ | }) | ||
+ | .join('' | ||
+ | }; | ||
+ | var params=new URLSearchParams(location.search); | ||
+ | if(x=params.get(" | ||
+ | { | ||
+ | var url = x.split(":" | ||
+ | var proto = url.shift(); | ||
+ | var params = url.shift(); | ||
+ | var target = url.join(":" | ||
+ | |||
+ | switch(proto){ | ||
+ | case " | ||
+ | location.href = caesar(decodeURI(target), | ||
+ | break; | ||
+ | case " | ||
+ | if(params == " | ||
+ | { | ||
+ | location.href = atob(decodeURI(target)); | ||
+ | } | ||
+ | break; | ||
+ | } | ||
} | } | ||
</ | </ | ||
</ | </ |