applicationcommon.php

Constants

PBKDF2_HASH_ALGORITHM

PBKDF2_HASH_ALGORITHM = "sha256"

PBKDF2_ITERATIONS

PBKDF2_ITERATIONS = 1000

PBKDF2_SALT_BYTE_SIZE

PBKDF2_SALT_BYTE_SIZE = 24

PBKDF2_HASH_BYTE_SIZE

PBKDF2_HASH_BYTE_SIZE = 24

HASH_SECTIONS

HASH_SECTIONS = 4

HASH_ALGORITHM_INDEX

HASH_ALGORITHM_INDEX = 0

HASH_ITERATION_INDEX

HASH_ITERATION_INDEX = 1

HASH_SALT_INDEX

HASH_SALT_INDEX = 2

HASH_PBKDF2_INDEX

HASH_PBKDF2_INDEX = 3

Functions

p()

p(  $var) 

Parameters

$var

create_hash()

create_hash(  $password) : string

生产hash值

Parameters

$password

创建的密码

Returns

string

validate_password()

validate_password(  $password,   $correct_hash) : boolean

验证密码做对比 提交的密码与数据库的hash值对比,成功返回true

Parameters

$password

提交密码

$correct_hash

数据库保存数据

Returns

boolean —

true || false

slow_equals()

slow_equals(  $a,   $b) 

Parameters

$a
$b

pbkdf2()

pbkdf2(  $algorithm,   $password,   $salt,   $count,   $key_length,   $raw_output = false) 

Parameters

$algorithm
$password
$salt
$count
$key_length
$raw_output

StrOrderOne()

StrOrderOne() 

StrOrderOne2()

StrOrderOne2() 

NoRand()

NoRand(  $begin = 1,   $end = 9,   $limit = 4) 

Parameters

$begin
$end
$limit

Setting_Config()

Setting_Config() 

AddSubDay()

AddSubDay(  $ntime,   $aday) 

Parameters

$ntime
$aday

ExecTime()

ExecTime() 

authCheck()

authCheck(  $rule,   $uid,   $true,   $false = '没有权限') 

Parameters

$rule
$uid
$true
$false

IS_ROOT()

IS_ROOT(  $item = array()) 

Parameters

$item

getAuthGroupTree()

getAuthGroupTree(  $data) 

Parameters

$data

get_numeric()

get_numeric(  $val) 

Parameters

$val

filterOrders()

filterOrders(  $val) 

Parameters

$val

filter_mount()

filter_mount(  $val) 

Parameters

$val

filter_numbers()

filter_numbers(  $val) 

Parameters

$val

CountDownDays()

CountDownDays(  $exec) 

Parameters

$exec

Shengchanzq()

Shengchanzq(  $pstart,   $pend) 

Parameters

$pstart
$pend

purchase_status()

purchase_status(  $value,   $list = 'list') 

Parameters

$value
$list

isInteger()

isInteger(  $input) 

Parameters

$input

cutstr_html()

cutstr_html(  $string) 

Parameters

$string

strFilter()

strFilter(  $str) 

Parameters

$str

cutstr_json()

cutstr_json(  $string) 

Parameters

$string

getTime()

getTime(  $Ymd = NULL,   $xia = false) 

获取时间戳 $Ymd = Y 年 $Ymd = m 月 $Ymd = d 日 $Ymd = NULL 当前时间戳 $xia = true 是否取下次开始时间戳:取下年开始时间戳 或者下月开始时间戳 或者明日开始时间戳

Parameters

$Ymd
$xia