mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-29 09:32:43 +00:00
Use mcschema hooks beta and watch things explode
This commit is contained in:
7
src/app/utils.ts
Normal file
7
src/app/utils.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
const dec2hex = (dec: number) => ('0' + dec.toString(16)).substr(-2)
|
||||
|
||||
export function hexId(length = 12) {
|
||||
var arr = new Uint8Array(length / 2)
|
||||
window.crypto.getRandomValues(arr)
|
||||
return Array.from(arr, dec2hex).join('')
|
||||
}
|
||||
Reference in New Issue
Block a user