Skip to content

Commit 330a413

Browse files
committed
shake256 changes
demo image
1 parent 3503896 commit 330a413

File tree

11 files changed

+266
-76
lines changed

11 files changed

+266
-76
lines changed

package-lock.json

Lines changed: 68 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"node-watch": "^0.7.3",
3131
"nodemon": "^2.0.22",
3232
"os-utils": "^0.0.14",
33+
"parse5": "^7.2.1",
3334
"pqc-dilithium": "^0.2.0",
3435
"qrcode": "^1.5.1",
3536
"sodium-native": "^4.0.1"

serverApp/compileUML.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { decode, encode } from '#utilities/serialize';
2+
import { parse, parseFragment } from 'parse5';
3+
// EXPERIMENTAL
4+
function htmlToJson(node, index) {
5+
console.log(node, index);
6+
if (node.length) {
7+
return node.map(htmlToJson);
8+
}
9+
if (node.nodeName === '#text') {
10+
return node.value.trim() ? node.value : null;
11+
}
12+
if (!node.tagName && node.childNodes?.length) {
13+
return htmlToJson(node.childNodes);
14+
}
15+
const tagName = node.tagName;
16+
const attributes = {};
17+
if (node.attrs) {
18+
for (const attr of node.attrs) {
19+
attributes[attr.name] = attr.value;
20+
}
21+
}
22+
const children = (node.childNodes || [])
23+
.map(htmlToJson)
24+
.filter((child) => {
25+
return child !== null;
26+
}); // Remove null entries
27+
return [
28+
tagName, Object.keys(attributes).length ? attributes : undefined, children.length ? children : undefined
29+
].filter((x) => {
30+
return x !== undefined;
31+
});
32+
}
33+
async function convertHtmlToMsgPack(html) {
34+
const doc = await parseFragment(html);
35+
console.log(doc.childNodes);
36+
const jsonStructure = await htmlToJson(doc.childNodes);
37+
console.dir(jsonStructure, {
38+
depth: null,
39+
colors: true
40+
});
41+
// return encode(jsonStructure);
42+
}
43+
// Example HTML
44+
const htmlContent = `<div id="container"><h1>Hello</h1><p class="text">World</p></div>`;
45+
// Convert and encode
46+
const packedData = await convertHtmlToMsgPack(htmlContent);
47+
// console.log('MessagePack Buffer:', packedData);
48+
// console.log('MessagePack length:', packedData.length, Buffer.from(htmlContent, 'utf8').length);
49+
console.dir(decode(packedData), {
50+
depth: null,
51+
colors: true
52+
});
422 KB
Loading

serverApp/resources/index.html

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,75 @@
2323
POWERED BY UW://
2424
A CUSTOM UDP BASED PROTOCOL
2525

26+
<h3>ASCII ART TEST</h3>
27+
<pre>
28+
⣿⣿⣿⣿⣿⣿⣟⣛⣻⣛⣛⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
29+
⣿⣿⣿⣿⢫⣿⣿⣿⢿⣿⣿⡿⢿⡾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
30+
⣿⣿⣿⡏⢈⣄⠈⠻⠂⠈⠉⢀⢀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
31+
⣿⣿⣿⡇⠈⢿⡆⢀⣀⣤⣶⣷⠆⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
32+
⣿⣿⣿⠁⢀⢀⠘⠛⠛⠛⠉⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
33+
⣿⣿⣿⢀⣤⣄⣀⡀⢀⢠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
34+
⣿⣿⡟⢀⣿⣿⣌⡃⢀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
35+
⣿⣿⢰⣾⣿⣿⣿⣷⡖⡸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
36+
⣿⣟⣾⣿⣿⣿⣿⣿⣧⡿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
37+
⠟⢻⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
38+
⢀⣮⣿⣿⣿⣿⡿⠿⠛⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
39+
⢀⠁⠉⠉⠁⢀⢀⢀⢀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
40+
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
41+
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
42+
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠿⠿⠿⣿⣿⣿⣿⣿⣿⣿
43+
⢀⢀⢀⢀⢀⢀⢀⢀⢀⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢟⣷⣾⣿⣿⣿⣿⣶⣾⣭⣽⢻⣿⣿
44+
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⠘⣿⣿⣿⣿⣿⣿⣿⠏⢀⠾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣹⣿
45+
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⠹⣿⣿⣿⣿⣿⡿⢀⣶⢠⣿⡿⠿⢿⣿⣿⣿⣿⣿⣿⡿⠖⢹
46+
⡄⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⠘⣿⣿⣿⣿⡇⢀⠋⢀⣤⣥⣤⣾⣿⣄⣐⣛⢿⣿⡇⢀⢸
47+
⡆⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⠘⣿⣿⣿⢀⢀⢀⠻⠿⢿⠉⠙⠙⢻⣿⣿⣿⣿⡄⢀⢸
48+
⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⠸⢿⣿⢀⡀⢀⣴⣿⡾⣙⢛⡻⣿⣿⣿⣿⣿⠃⢀⠈
49+
⡇⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⠈⠉⢀⠃⢀⠘⢛⣫⣷⣾⠟⠋⠙⠻⠿⠿⢆⣀⣼
50+
⡇⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⠈⠛⠈⢀⢀⢀⢀⢀⢀⢀⢀⣿⣿
51+
⠁⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⢀⠈⠉⠉
52+
</pre>
53+
<pre>
54+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⠀⣀⠀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀
55+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⣠⡄⣶⡖⣿⣟⠀⢸⣿⣾⣿⢹⡟⢻⡷⣾⠿⣿⣴⣶⣄⡄
56+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠶⣿⡟⢹⣷⢽⠷⠹⠗⠂⠀⢃⣉⣈⣀⣙⣋⣁⠙⠒⠋⠼⠛⡿⠁
57+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⢰⡿⢿⡆⠀⠘⠓⠀⣁⣠⣤⣶⣦⡘⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣦⡄⠀
58+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠰⡾⣿⡉⠻⠞⢃⣠⣴⣾⣿⣿⣿⣿⣿⣿⣿⣦⡙⢿⣿⣿⣿⠇⠰⣦⠘⣿⣿⣿⠇⠀
59+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⣤⣤⣤⣤⣤⠙⣃⣴⡾⣫⣭⡻⣿⣿⣿⡿⣟⣛⢿⣿⣿⣿⣆⠻⣿⣿⣇⣈⣁⣼⣿⣿⡟⠀⠀
60+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣾⣿⣿⣿⣿⣿⡿⢋⣠⣾⣿⣿⡇⡏⠈⢻⣜⣛⣫⡾⠋⢹⡏⣿⣿⣿⣿⣧⡘⣿⣿⣿⣿⢏⣾⡟⠀⠀⠀
61+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢶⣌⠻⣿⣿⣿⣿⡿⢋⣴⣿⣿⣿⡿⣫⡵⠇⠀⠀⠉⠉⠉⠀⠀⢸⡇⣿⣿⣿⣿⣿⣷⡘⣿⣿⣷⣿⡟⠀⠀⠀⠀
62+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⣷⣌⠻⣿⠟⣰⣿⣿⣿⣿⡟⣼⠃⢠⡄⠀⠀⠀⠀⠀⠀⠀⠘⣷⢻⣿⣿⣿⣿⣿⣷⠘⣿⣿⠟⠀⠀⠀⠀⠀
63+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠷⢠⠸⣿⣿⣿⣿⣿⢸⠇⠀⣈⠀⠀⠐⠽⠃⠀⠀⠀⠀⠸⡇⣿⣿⣿⣿⣿⣿⣧⠹⠋⠀⠀⠀⠀⠀⠀
64+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠀⢿⣧⠹⣿⣿⣿⣿⢿⠀⠈⠿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⡿⣿⣿⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀
65+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠒⠢⠍⠊⢿⣧⢻⣿⣿⣿⡼⣇⠀⠓⠒⠐⠂⠀⠀⠀⠀⠀⠀⣸⢇⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀
66+
⠀⠀⠀⠀⠀⠀⠀⣀⣤⣶⣿⣿⣿⣿⣿⠿⠶⠦⠄⠀⢻⣧⠹⣿⣿⣷⡝⣦⡀⠀⠀⠀⠀⠀⠀⠀⢀⣴⢫⣾⢟⣽⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
67+
⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣭⣤⣀⣀⠀⠀⠀⠀⠀⠹⣷⡙⣿⣿⣿⣮⣝⡷⢦⣤⣤⣤⡴⢾⣫⡵⢟⣵⡿⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
68+
⠀⠀⠀⠀⣼⣿⡿⠿⢿⣿⣿⣿⣿⣿⡿⠟⠋⠀⠀⠀⠀⠀⠘⢿⣎⠻⣿⣿⣿⣿⣿⣶⣶⣶⣿⠿⣫⣴⠿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
69+
⠀⠀⠀⠸⠋⠀⢀⣴⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠹⣷⣝⢿⣿⣿⣿⣿⣿⣿⣷⠿⠛⣡⣴⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
70+
⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⠋⠀⠀⠀⢀⣀⣠⣤⣤⠀⠀⠀⢸⡆⠈⠻⣷⣝⠿⣿⠷⠟⣋⣥⣶⣿⣿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
71+
⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⡏⢀⣠⣴⣾⣿⣿⣿⣿⣿⠀⠀⠀⣼⡇⠀⢠⠀⠉⣡⠀⣶⣿⣿⣿⣿⣿⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
72+
⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⢀⣼⣿⡇⢠⠸⠀⠀⢹⣇⢹⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
73+
⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⢸⣿⣿⣴⣿⣿⡟⠀⡞⠀⠀⠀⠀⢻⣦⠻⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
74+
⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⣿⣿⣿⣿⣿⠟⢀⠞⠀⠀⠀⠀⠀⠀⠙⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
75+
⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⡿⠟⠉⠀⠀⢀⣼⣿⣿⡿⠟⠁⠔⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
76+
⠐⠺⠿⠿⠿⠿⠟⠛⠋⠁⠀⠀⠀⠀⠐⠛⠛⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
77+
</pre>
78+
<pre>
79+
80+
__ __ __ __ ______ __ ______
81+
/\ \ _ \ \/\ \_\ \/\ __ \ /\ \/\ ___\
82+
\ \ \/ ".\ \ \ __ \ \ \/\ \ \ \ \ \___ \
83+
\ \__/".~\_\ \_\ \_\ \_____\ \ \_\/\_____\
84+
\/_/ \/_/\/_/\/_/\/_____/ \/_/\/_____/
85+
86+
__ ______ __ __ __ __ ______ ______ __ ______
87+
/\ \/\ __ \/\ \_\ \/\ "-.\ \ /\ ___\/\ __ \/\ \ /\__ _\
88+
_\_\ \ \ \/\ \ \ __ \ \ \-. \ \ \ \__ \ \ __ \ \ \___\/_/\ \/
89+
/\_____\ \_____\ \_\ \_\ \_\\"\_\ \ \_____\ \_\ \_\ \_____\ \ \_\
90+
\/_____/\/_____/\/_/\/_/\/_/ \/_/ \/_____/\/_/\/_/\/_____/ \/_/ ?
91+
92+
93+
</pre>
94+
2695
.---------------------------------------.
2796
| ██████████ ██████ █████ ██████████ |
2897
|░░███░░░░░█░░██████ ░░███ ░░███░░░░███ |

0 commit comments

Comments
 (0)