* @author Chuck Hagenbuch * @category Horde * @package Token */ class Horde_Token { /** * Generates a connection id and returns it. * * @param string $seed A unique ID to be included in the token. * * @return string The generated id string. */ public static function generateId($seed = '') { return Horde_Url::uriB64Encode(pack('H*', hash('sha1', uniqid(mt_rand()) . $seed . (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '')))); } }