In many situations, we need to generate tokens and then verify them (for example in the flow of a password reset). This document shows how to do so with FoalTS.
generateToken function generates a cryptographically secure random token encoded in base64url (128 bits)
You can also generate a token using a secret. The secret is used to sign the token to provide extra security. It must be encoded in base64. You can generate one with the following command:
Generate a signed token
Verify and read a signed token