feat: render relay description content
This commit is contained in:
parent
0d6f8789d0
commit
ee90ae99c1
3 changed files with 9 additions and 4 deletions
|
|
@ -1,9 +1,11 @@
|
|||
const SEED = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
|
||||
const HEX_SEED = 'abcdef0123456789'
|
||||
|
||||
export function randomString(len = 32) {
|
||||
export function randomString(len = 32, { hex } = { hex: false }) {
|
||||
let str = ''
|
||||
const seed = hex ? HEX_SEED : SEED
|
||||
for (let i = 0; i < len; i++) {
|
||||
str += SEED[Math.floor(Math.random() * SEED.length)]
|
||||
str += seed[Math.floor(Math.random() * SEED.length)]
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue