Example #1
0
function bchexdec($hex)
{
    $res = 0;
    for ($i = 0; $i < strlen($hex); $i++) {
        $res = bcadd(bcleftshift($res, 4), hexdec($hex[$i]));
    }
    return $res;
}
Example #2
0
 function LoomClient($prefix = 'https://loom.cc/')
 {
     if (substr($prefix, -1) != '/') {
         $prefix .= '/';
     }
     $this->url_prefix = $prefix;
     $this->bits128 = bcsub(bcleftshift(1, 128), 1);
     $this->socket = FALSE;
     $this->random = new LoomRandom();
 }