39 constexpr static size_t kLength = 16;
41 explicit Uuid(std::array<uint8_t, kLength> data);
66 std::span<const uint8_t>
bytes()
const {
return data_; }
77 friend bool operator==(
const Uuid& lhs,
const Uuid& rhs) {
78 return lhs.data_ == rhs.data_;
81 int64_t high_bits()
const;
82 int64_t low_bits()
const;
85 std::array<uint8_t, kLength> data_;
std::string ToString() const override
Convert the UUID to a string in standard format.
static Result< Uuid > FromBytes(std::span< const uint8_t > bytes)
Create a UUID from a 16-byte array.
static Result< Uuid > FromString(std::string_view str)
Create a UUID from a string in standard format.
static Uuid GenerateV7(uint64_t unix_ts_ms)
Generate UUID version 7 per RFC 9562, with the given timestamp.
uint8_t operator[](size_t index) const
Access individual bytes of the UUID.
static Uuid GenerateV7()
Generate UUID version 7 per RFC 9562, with the current timestamp.
std::span< const uint8_t > bytes() const
Get the raw bytes of the UUID.
Definition uuid.h:66
static Uuid GenerateV4()
Generate a random UUID (version 4).
Define symbol visibility macros for core Iceberg APIs.
Core Apache Iceberg C++ APIs.
Definition arrow_io_util.h:33
std::expected< T, E > Result
Result alias.
Definition result.h:88
Define Result, Status, and error helpers.