Documentation for the Textpattern plugin smd_token by Stef Dawson follows this short message from our sponsor ;-)
If you like my code and find it useful, feel free to show your appreciation with something from my UK Amazon wish list (or US) or donate to the Stef Dawson community coding pot, either via paypal.me/stefdawson or by following the Donate button below to PayPal. Thanks!
Public tag to return a cryptographically secure sequence of characters. Very handy for using inside plugins or CSP headers.
Installation / Uninstallation
To uninstall, delete the plugin from the Admin->Plugins panel.
16-character tokens are default therefore to return a 16-character randomly-generated token:
Display a 24-character randomly-generated token:
<txp:smd_token length="24" />
Display a 12-character randomly-generated token with a prefix:
<txp:smd_token length="12" prefix="nonce-" />
Outputs something like
Author / credits
Written by Stef Dawson.
If you’d rather frolic in the raw code halls, you’ll need to step into the view source page.
If, for some inexplicable reason, you need an ancient version of a plugin, it can probably be found on the plugin archive page.
If you’re feeling brave, or fancy skateboarding into volcanos, you can test out some of my beta code. It can be found on the plugin beta page.