30 for (
size_t i = 0; i <
sizeof (uuid); ++i)
31 uuid[i] = (uint8) (r.
nextInt (256));
34 uuid[6] = (uuid[6] & 0x0f) | 0x40;
35 uuid[8] = (uuid[8] & 0x3f) | 0x80;
52bool Uuid::operator!= (
const Uuid& other)
const noexcept {
return ! operator== (other); }
54bool Uuid::operator< (
const Uuid& other)
const noexcept {
return compare (other) < 0; }
55bool Uuid::operator> (
const Uuid& other)
const noexcept {
return compare (other) > 0; }
56bool Uuid::operator<= (
const Uuid& other)
const noexcept {
return compare (other) <= 0; }
57bool Uuid::operator>= (
const Uuid& other)
const noexcept {
return compare (other) >= 0; }
59int Uuid::compare (Uuid other)
const noexcept
61 for (
size_t i = 0; i <
sizeof (uuid); ++i)
62 if (
int diff = uuid[i] - (
int) other.uuid[i])
63 return diff > 0 ? 1 : -1;
70 return Uuid ((
const uint8*)
nullptr);
82String Uuid::getHexRegion (
int start,
int length)
const
89 return getHexRegion (0, 16);
94 return getHexRegion (0, 4)
95 +
"-" + getHexRegion (4, 2)
96 +
"-" + getHexRegion (6, 2)
97 +
"-" + getHexRegion (8, 2)
98 +
"-" + getHexRegion (10, 6);
110 mb.ensureSize (
sizeof (uuid),
true);
111 mb.copyTo (uuid, 0,
sizeof (uuid));
125 zeromem (uuid,
sizeof (uuid));
142 result = ((
uint64) 101) * result + n;
static JUCE_CONSTEXPR uint16 bigEndianShort(const void *bytes) noexcept
static JUCE_CONSTEXPR uint32 bigEndianInt(const void *bytes) noexcept
static String toHexString(IntegerType number)
uint64 hash() const noexcept
Uuid & operator=(const Uuid &) noexcept
uint8 getClockSeqAndReserved() const noexcept
uint16 getTimeMid() const noexcept
uint32 getTimeLow() const noexcept
uint8 getClockSeqLow() const noexcept
uint16 getTimeHighAndVersion() const noexcept
bool isNull() const noexcept
String toDashedString() const
uint64 getNode() const noexcept
static Uuid null() noexcept