You are here

function _openid_nonce in Drupal 6

Same name and namespace in other branches
  1. 7 modules/openid/openid.inc \_openid_nonce()

Return a nonce value - formatted per OpenID spec.

File

modules/openid/openid.inc, line 185
OpenID utility functions.

Code

function _openid_nonce() {

  // YYYY-MM-DDThh:mm:ssTZD UTC, plus some optional extra unique chars
  return gmstrftime('%Y-%m-%dT%H:%M:%S%Z') . chr(mt_rand(0, 25) + 65) . chr(mt_rand(0, 25) + 65) . chr(mt_rand(0, 25) + 65) . chr(mt_rand(0, 25) + 65);
}