SproutCMS

This is the code documentation for the SproutCMS project

function generateSecret()

Generate a secret key and encode as base32

NOTE: Only cryptographically secure in PHP 7.0 onwards (uses "random_bytes" method)
On earlier versions of PHP this method isn't available so rand() is used instead

Usage

string $GoogleAuthenticator->generateSecret ( );

Return value

  • string
    Randomly generated secret key