randomId

fun randomId(length: Int = 10, charPool: List<Char> = ('a'..'z') + ('A'..'Z') + ('0'..'9')): String

Generates a cryptographically secure random alphanumeric string.

Return

a random string of the specified length

Parameters

length

the length of the generated ID (default 10)

charPool

the characters to choose from (default: a-z, A-Z, 0-9)