13 |
* $Id$ |
* $Id$ |
14 |
* |
* |
15 |
* $Log$ |
* $Log$ |
16 |
|
* Revision 1.3 2003/04/08 22:35:16 joko |
17 |
|
* + 'function yesno' from utils/links.php |
18 |
|
* |
19 |
|
* Revision 1.2 2003/04/06 01:37:31 jonen |
20 |
|
* + added functions to generate and handle unique ID's |
21 |
|
* |
22 |
* Revision 1.1 2003/04/05 19:53:45 joko |
* Revision 1.1 2003/04/05 19:53:45 joko |
23 |
* moved here from ../ |
* moved here from ../ |
24 |
* |
* |
643 |
|
|
644 |
} |
} |
645 |
|
|
646 |
|
//examples on howto create unique id's |
647 |
|
// from: http://www.php.net/manual/en/function.uniqid.php |
648 |
|
function CreateGUID(){ |
649 |
|
srand((double)microtime()*1000000); |
650 |
|
$r = rand ; |
651 |
|
$u = uniqid(getmypid() . $r . (double)microtime()*1000000,1); |
652 |
|
$m = md5 ($u); |
653 |
|
return($m); |
654 |
|
} |
655 |
|
|
656 |
|
function CompressID( $ID ){ |
657 |
|
return(Base64_encode(pack("H*",$ID))); |
658 |
|
} |
659 |
|
|
660 |
|
function ExpandID ($ID){ |
661 |
|
return ( implode(unpack("H*",Base64_decode($ID)), '') ); |
662 |
|
} |
663 |
|
|
664 |
|
// from: utils/links.php |
665 |
|
function yesno($bool) { |
666 |
|
return $bool ? 'yes' : 'no'; |
667 |
|
} |
668 |
|
|
669 |
} |
} |
670 |
|
|