Word description Generate a password of length n by randomly selecting characters from the charset string. All characters of the charset have equal probability of appearing at any position of the result.
If n = 0, return empty string. If n < 0, throw an error.