explore: generate session id

This commit is contained in:
Helmut Merz 2023-03-02 10:03:39 +01:00
parent 97b0629de0
commit 3c859c0931

View file

@ -37,6 +37,15 @@ export const pvapp = {
}
}
// components
function Data() {
return {
data: {},
save
}
}
// appdata method definitions
function save() {
@ -52,7 +61,15 @@ function poll() {
dopoll(this)
}
// basic functions
// basic functions - move to api.ts
function createSid(): string {
const arr = new Uint32Array(2)
crypto.getRandomValues(arr)
return arr[0].toString(36) + arr[1].toString(36)
}
console.log("sid: ", createSid())
async function dopoll(app: typeof appdata) {
while (true) {