PHP Class Thruway\Common\Utils

显示文件 Open project: voryx/thruway Class Usage Examples

Public Methods

Method Description
checkPrecision ( ) Changes the Precision for PHP configs that default to less than 16
compat_pbkdf2 ( string $algo, string $password, string $salt, integer $iterations, integer $length, boolean $rawOutput = false ) : string Generate a PBKDF2 key derivation of a supplied password
getDerivedKey ( string $key, string $salt, integer $iterations = 1000, integer $keyLen = 32 ) : string Encode and get derived key
getUniqueId ( ) : mixed Generate a unique id for sessions and requests
uriIsValid ( $uri ) : boolean Strict URI Test

Method Details

checkPrecision() public static method

Changes the Precision for PHP configs that default to less than 16
public static checkPrecision ( )

compat_pbkdf2() public static method

This is a hash_pbkdf2() implementation for PHP versions 5.3 and 5.4.
See also: https://gist.github.com/rsky/5104756
public static compat_pbkdf2 ( string $algo, string $password, string $salt, integer $iterations, integer $length, boolean $rawOutput = false ) : string
$algo string
$password string
$salt string
$iterations integer
$length integer
$rawOutput boolean
return string

getDerivedKey() public static method

Encode and get derived key
public static getDerivedKey ( string $key, string $salt, integer $iterations = 1000, integer $keyLen = 32 ) : string
$key string
$salt string
$iterations integer
$keyLen integer
return string

getUniqueId() public static method

Generate a unique id for sessions and requests
public static getUniqueId ( ) : mixed
return mixed

uriIsValid() public static method

Strict URI Test
public static uriIsValid ( $uri ) : boolean
$uri
return boolean