# variant property

int get variant

Gets the variant number of the UUID.

Returns:

- Variant number (typically 2 for RFC 4122 UUIDs)

## Variant Meanings

- 0: Reserved for NCS backward compatibility
- 2: RFC 4122 variant (standard)
- 6: Reserved for Microsoft backward compatibility
- 7: Reserved for future definition

## Implementation

    int get variant {
      final variantBits = (_leastSigBits >> 61) & BigInteger.fromInt(0x07);
      if ((variantBits & BigInteger.fromInt(0x04)) == BigInteger.ZERO) return 0;
      if ((variantBits & BigInteger.fromInt(0x02)) == BigInteger.ZERO) return 2;
      if ((variantBits & BigInteger.fromInt(0x01)) == BigInteger.ZERO) return 6;
      return 7;
    }