public static function bytes2int($str, $l = false)
    {
        if ($l) {
            $str = strrev($str);
        }

        $dec = 0;
        $len = strlen($str);

        for ($i = 0; $i < $len; ++$i)
        {
            $dec += ord(static::binarySubstr($str, $i, 1)) * pow(0x100, $len - $i - 1);
        }

        return $dec;
    }