diff --git a/index.html b/index.html index 822890f..e6ebcc9 100644 --- a/index.html +++ b/index.html @@ -100,7 +100,7 @@ __ __ _____ __ __ _____ - +

diff --git a/main.js b/main.js index 84af8a1..edb11f9 100644 --- a/main.js +++ b/main.js @@ -3,7 +3,14 @@ const { createApp } = Vue let app = createApp({ computed: { - crypto: () => window.crypto, + randomID: () => { + let buf2hex = function(buffer) { // buffer is an ArrayBuffer + return [...new Uint8Array(buffer)] + .map(x => x.toString(16).padStart(2, '0')) + .join(''); + } + return buf2hex(window.crypto.getRandomValues(new Uint8Array(25))) + }, onLine: () => window.navigator.onLine }, data() {