Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

ACL GENPASS

Last updated
ACL GENPASS [bits]
Group
ACL
Complexity
O(N) where N is the number of bits
Arity
-2 (at least 2 words, counting the command name)
HotKV Cloud
All plans
On-Premise
no license needed

ACL GENPASS returns a random password made of lowercase hexadecimal digits, taken from the operating system’s cryptographically secure random generator. By default it has 256 bits of randomness, 64 characters. With bits, you get that many bits, rounded up to a whole number of hex digits (4 bits each). Nothing is stored: pass the result to ACL SETUSER with >password.

Argument Meaning
bits Bits of randomness, from 1 to 4096 (default 256).
Case RESP2 RESP3
Success Bulk string: the password Bulk string
bits not an integer Error ERR value is not an integer or out of range Same error
bits outside 1 to 4096 Error ERR ACL GENPASS argument must be the number of bits for the output password, a positive number up to 4096 Same error
127.0.0.1:6379> ACL GENPASS
"6a1e5774f0c9831097d0f74a8e2072ade4869561a12db025038ac7e9ccfc7153"
127.0.0.1:6379> ACL GENPASS 32
"9f3c07b2"
127.0.0.1:6379> ACL GENPASS 5
"e4"

Same as Redis 7 and Valkey 8.

ACL SETUSER