public function variant(): int
    {
        $octet = hexdec($this->clockSeqHiAndReserved);

        // test if the most significant bit is 0
        if (0b11111111 !== ($octet | 0b01111111)) {
            return static::VARIANT_RESERVED_NCS;
        }

        // test if the two most significant bits are 10
        if (0b10111111 === ($octet | 0b00111111)) {
            return static::VARIANT_RFC_4122;
        }

        // test if the three most significant bits are 110
        if (0b11011111 === ($octet | 0b00011111)) {
            return static::VARIANT_RESERVED_MICROSOFT;
        }

        // the most significant bits are 111
        return static::VARIANT_RESERVED_FUTURE;
    }