def get_least_significant_bits(uuid_val):
    """Equivalent to getLeastSignificantBits() in Java."""
    lsb_s = ''.join(str(uuid_val).split('-')[-2:])
    lsb = int(lsb_s, 16)
    if int(lsb_s[0], 16) > 7:
        lsb = lsb - 0x10000000000000000
    return lsb