Switch away from AES to 3 key XOR
This commit is contained in:
parent
a6473f3e77
commit
aba3153c4f
1 changed files with 25 additions and 2 deletions
|
|
@ -1,8 +1,31 @@
|
||||||
self.__uv$config = {
|
self.__uv$config = {
|
||||||
prefix: "/~/uv/",
|
prefix: "/~/uv/",
|
||||||
bare: "/bare/",
|
bare: "/bare/",
|
||||||
encodeUrl: Ultraviolet.codec.aes.encode,
|
encodeUrl: function encode(str) {
|
||||||
decodeUrl: Ultraviolet.codec.aes.decode,
|
if (!str) return str;
|
||||||
|
return encodeURIComponent(
|
||||||
|
str
|
||||||
|
.toString()
|
||||||
|
.split('')
|
||||||
|
.map((char, ind) =>
|
||||||
|
ind % 2 ? String.fromCharCode(char.charCodeAt() ^ 3) : char
|
||||||
|
)
|
||||||
|
.join('')
|
||||||
|
);
|
||||||
|
},
|
||||||
|
decodeUrl: function decode(str) {
|
||||||
|
if (!str) return str;
|
||||||
|
let [input, ...search] = str.split('?');
|
||||||
|
|
||||||
|
return (
|
||||||
|
decodeURIComponent(input)
|
||||||
|
.split('')
|
||||||
|
.map((char, ind) =>
|
||||||
|
ind % 2 ? String.fromCharCode(char.charCodeAt(0) ^ 3) : char
|
||||||
|
)
|
||||||
|
.join('') + (search.length ? '?' + search.join('?') : '')
|
||||||
|
);
|
||||||
|
},
|
||||||
handler: "/uv/uv.handler.js",
|
handler: "/uv/uv.handler.js",
|
||||||
client: "/uv/uv.client.js",
|
client: "/uv/uv.client.js",
|
||||||
bundle: "/uv/uv.bundle.js",
|
bundle: "/uv/uv.bundle.js",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue