MagicSmoke  $VERSION$
random.php File Reference

Functions

 code39IsInRange ($code, $range=RND_ANYRANGE, $length=-1)
 returns whether a barcode matches a specific range More...
 
 getCode39ID ($length, $range=RND_ANYRANGE)
 return a new Code-39 capable ID; length is the amount of characters More...
 
 getRandom ($bits)
 return $bits bits of random data as hex string More...
 
 getSalt ()
 return a salt value for Customer::setPassword More...
 
 randseedfile ($fn, $sz)
 
 randseedinit ()
 

Variables

 $RANDCTR =0
 
 $RANDSEED =""
 
 return
 
const RND_ANYRANGE -1
 
const RND_CODE39_CHARS "123456789ABCDEFGHJKLMNPQRSTUVWXYZ"
 
const RND_COUPON 0x10
 
const RND_MASK 7
 
const RND_OTHER2 0x18
 
const RND_TICKET 0x00
 
const RND_VOUCHER 0x08
 

Function Documentation

code39IsInRange (   $code,
  $range = RND_ANYRANGE,
  $length = -1 
)

returns whether a barcode matches a specific range

References $i, RND_ANYRANGE, RND_CODE39_CHARS, and RND_MASK.

Referenced by BarcodeTable\checkCouponIdValid().

getCode39ID (   $length,
  $range = RND_ANYRANGE 
)
getRandom (   $bits)

return $bits bits of random data as hex string

References $RANDCTR, $RANDSEED, and randseedinit().

Referenced by getCode39ID(), getSalt(), Session\login(), and WOCustomer\resetPassword().

getSalt ( )

return a salt value for Customer::setPassword

References getRandom().

Referenced by MachineUser\changePasswd(), MachineUser\createUser(), and Session\passwdHash().

randseedfile (   $fn,
  $sz 
)

References $RANDSEED.

Referenced by randseedinit().

randseedinit ( )

References $RANDSEED, and randseedfile().

Referenced by getRandom().

Variable Documentation

$RANDCTR =0

Referenced by getRandom().

$RANDSEED =""
return
const RND_ANYRANGE -1

Referenced by code39IsInRange(), and getCode39ID().

const RND_CODE39_CHARS "123456789ABCDEFGHJKLMNPQRSTUVWXYZ"

Referenced by code39IsInRange(), and getCode39ID().

const RND_COUPON 0x10
const RND_MASK 7

Referenced by code39IsInRange(), and getCode39ID().

const RND_OTHER2 0x18
const RND_TICKET 0x00
const RND_VOUCHER 0x08