I need to generate one time use only and unique like Stripe tokens for a banking application (production only) to represent accounts and transactions, what would be a secure and appropriate method of doing this?
Could I use random_bytes()
?
It would be preferable if the tokens were alphanumeric and not just numbers.
For example, Stripe tokens look like tok_382r1O2IZ7IgsfwNFATX4xax
base64
since it would be shorter thanbin2hex
– Ovariotomy