function bchexdec($hex) { $res = 0; for ($i = 0; $i < strlen($hex); $i++) { $res = bcadd(bcleftshift($res, 4), hexdec($hex[$i])); } return $res; }
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(); }