status flag

This commit is contained in:
2016-03-11 07:41:51 +01:00
parent bc74d92463
commit 9c25312cf1
8 changed files with 49 additions and 5 deletions

View File

@@ -368,6 +368,17 @@ class Helper {
return $result;
}
public static function setBit($val,$index,$bit_on){
$flag = +$val;
if ( $bit_on ){
$flag |= 1 << $index;
}else{
$flag &= ~ (1 << $index);
}
return $flag;
}
public static function generateRandomString($length = 6,$characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWX' ) {
$charactersLength = strlen($characters);
$randomString = '';