Files
speckle-server/packages/frontend-2/lib/common/helpers/random.ts
T
Kristaps Fabians Geikins b02a07e2b6 feat: Frontend 2.0 MVP
2023-05-08 10:47:01 +03:00

9 lines
224 B
TypeScript

/**
* Generate a random string of any length
*/
export function randomString(length: number): string {
return Math.round(Math.pow(36, length + 1) - Math.random() * Math.pow(36, length))
.toString(36)
.slice(1)
}