framework/base/CSecurityManager.php
public function generateSessionRandomBlock()
	{
		ini_set('session.entropy_length',20);
		if(ini_get('session.entropy_length')!=20)
			return false;

		// These calls are (supposed to be, according to PHP manual) safe even if
		// there is already an active session for the calling script.
		@session_start();
		@session_regenerate_id();

		$bytes=session_id();
		if(!$bytes)
			return false;

		// $bytes has 20 bytes of entropy but the session manager converts the binary
		// random bytes into something readable. We have to convert that back.
		// SHA-1 should do it without losing entropy.
		return sha1($bytes,true);
	}
public function generateSessionRandomBlock()
	{
		ini_set('session.entropy_length',20);
		if(ini_get('session.entropy_length')!=20)
			return false;

		// These calls are (supposed to be, according to PHP manual) safe even if
		// there is already an active session for the calling script.
		@session_start();
		@session_regenerate_id();

		$bytes=session_id();
		if(!$bytes)
			return false;

		// $bytes has 20 bytes of entropy but the session manager converts the binary
		// random bytes into something readable. We have to convert that back.
		// SHA-1 should do it without losing entropy.
		return sha1($bytes,true);
	}
public function generateSessionRandomBlock ( ) { ini_set ( 'session.entropy_length' , 20 ) ; if ( ini_get ( 'session.entropy_length' ) != 20 ) return false ; // These calls are (supposed to be, according to PHP manual) safe even if // there is already an active session for the calling script. @ session_start ( ) ; @ session_regenerate_id ( ) ; $ bytes = session_id ( ) ; if ( ! $ bytes ) return false ; // $bytes has 20 bytes of entropy but the session manager converts the binary // random bytes into something readable. We have to convert that back. // SHA-1 should do it without losing entropy. return sha1 ( $ bytes , true ) ; }
Get random bytes from the system entropy source via PHP session manager.
@return boolean|string 20-byte random binary string or false on error.
@since 1.1.14
Get random bytes from the system entropy source via PHP session manager .