> > I have 2 values. The first is a constant while the second is not.
> Is the first value a numerical value (real/integer?) or a
> string value?
String.
This is what I've come up with and it seems to work pretty ok.
What do you guys think?
(test code to illustrate a point; other than the XORing, not
what I'm actually going to do with the "live" code)
<script language="php">
$uniqueArray = array();
for( $i = 0; $i <= 100; $i++ ) {
$certnum = date( "U" ); // what the second variable is always set
to
if( $certnum == $lastCertNum ) {
sleep( 1 );
}
$uid = ( $uid == "nsa000" ) ? "mdb000" : "nsa000"; // sample first
variable
$uniqueNum = ( hexdec( $uid ) ^ $certnum );
echo "$uid ^ $certnum = $uniqueNum<br>\n";
if( in_array( $uniqueNum, $uniqueArray )) {
echo "Not a unique number!<br><br>\n";
}
$uniqueArray[] = $uniqueNum;
flush();
$lastCertNum = $certnum;
}
</script>
Chris