private static function _decodeLongFormTag(string $data, int &$offset): string
    {
        $datalen = strlen($data);
        $tag = gmp_init(0, 10);
        while (true) {
            if ($offset >= $datalen) {
                throw new DecodeException(
                    "Unexpected end of data while decoding" .
                    " long form identifier.");
            }
            $byte = ord($data[$offset++]);
            $tag <<= 7;
            $tag |= 0x7f & $byte;
            // last byte has bit 8 set to zero
            if (!(0x80 & $byte)) {
                break;
            }
        }
        return gmp_strval($tag, 10);
    }