backup
parent
46e9a54a20
commit
04773e50fc
@ -0,0 +1,32 @@
|
||||
const saltMaster = "xG7t;a$LN=D5";
|
||||
const saltAdmin = "mXA4H_xb$g)c";
|
||||
|
||||
function hash(m, salt) {
|
||||
var result = "";
|
||||
if (m.length != 24) throw "Invalid id";
|
||||
for (var i = 0; i < 12; i++) {
|
||||
//console.log(x.charAt(i));
|
||||
playground = 0;
|
||||
playground += salt.charCodeAt(i);
|
||||
playground ^= m.charCodeAt(i);
|
||||
playground ^= m.charCodeAt(i + 12);
|
||||
playground &= 0xff;
|
||||
playground %= 10;
|
||||
result += playground.toString();
|
||||
}
|
||||
// console.log(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
function getKeys(uid) {
|
||||
var keys;
|
||||
try {
|
||||
keys = {
|
||||
User: hash(uid, saltMaster),
|
||||
Admin: hash(uid, saltAdmin),
|
||||
};
|
||||
} catch (error) {
|
||||
keys = { err: "Invalid id" };
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
extends layout.pug
|
||||
block content
|
||||
h1 flasher
|
||||
@ -1,14 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Anka Anvil</title>
|
||||
</head>
|
||||
<body>
|
||||
HEllo2
|
||||
<div id="terminal"></div>
|
||||
<script src="js/ss.js" type="module"></script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,21 +1,8 @@
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
title Anka Anvil
|
||||
body
|
||||
h1 #{title}
|
||||
h2 asdasd
|
||||
h2#terminal
|
||||
h1= title
|
||||
div= foo
|
||||
div
|
||||
label Bar
|
||||
input(
|
||||
type='text'
|
||||
name='city'
|
||||
placeholder='start typing...'
|
||||
)
|
||||
input(type='submit' id='submitbtn' value='Submit')
|
||||
script.
|
||||
document.addEventListener('keydown', event => {console.log("Bleep!")})
|
||||
document.getElementById('submitbtn').addEventListener('click', () => doSomething())
|
||||
extends layout.pug
|
||||
block scripts
|
||||
script(src='/jquery.js')
|
||||
script(src='/pets.js')
|
||||
|
||||
block content
|
||||
h1 hello world from index
|
||||
p hi
|
||||
@ -0,0 +1,3 @@
|
||||
extends layout.pug
|
||||
block content
|
||||
h1 invoice signer
|
||||
@ -0,0 +1,15 @@
|
||||
html
|
||||
head
|
||||
title My Site - #{title}
|
||||
block scripts
|
||||
script(src='/jquery.js')
|
||||
body
|
||||
ul
|
||||
each route in routes
|
||||
li
|
||||
a(href=route.link)= route.name
|
||||
|
||||
block content
|
||||
block foot
|
||||
#footer
|
||||
p some footer content
|
||||
@ -0,0 +1,19 @@
|
||||
extends layout.pug
|
||||
block scripts
|
||||
script(src='/js/pGenerator.js')
|
||||
block content
|
||||
h1 p_generator
|
||||
p UID:
|
||||
input(id="in-id" type="text" name="imdb" placeholder="please input your device id")
|
||||
button(onclick='clickme()') get keys
|
||||
p
|
||||
#response
|
||||
script.
|
||||
function clickme() {
|
||||
var id = document.getElementById("in-id");
|
||||
console.log(id.value);
|
||||
var keys = getKeys(id.value);
|
||||
console.log(keys);
|
||||
var resp = document.getElementById("response");
|
||||
resp.innerHTML = JSON.stringify(keys);
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
extends layout.pug
|
||||
block content
|
||||
h1 pcb panelizer
|
||||
@ -0,0 +1,17 @@
|
||||
routes = [
|
||||
{ name: "Homepage", renderFile: "index", link: "/" },
|
||||
{ name: "Flasher", renderFile: "flasher", link: "/flasher" },
|
||||
{
|
||||
name: "Password Generator",
|
||||
renderFile: "p_generator",
|
||||
link: "/p_generator",
|
||||
},
|
||||
{
|
||||
name: "PCB Panel BOM generator",
|
||||
renderFile: "pcb_panel_bom",
|
||||
link: "/pcb_panel_bom",
|
||||
},
|
||||
{ name: "Invoice Signer", renderFile: "invoice_sign", link: "/invoice_sign" },
|
||||
];
|
||||
|
||||
module.exports = routes;
|
||||
Loading…
Reference in New Issue