rand::random / thread_rng is not a CSPRNG guarantee for tokens, keys, or nonces.
Use a CSPRNG (rand::rngs::OsRng / getrandom) for security-sensitive values.