obsidian-desci_Obsidian-Desci/utils/utils.ts
2023-09-04 21:24:13 +02:00

10 lines
No EOL
225 B
TypeScript

/**
* Generate a string of random hexadecimal chars
*/
export const randomHexString = (len: number) => {
const t = []
for (let n = 0; n < len; n++) {
t.push((16 * Math.random() | 0).toString(16))
}
return t.join("")
}