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