| 366 | } |
| 367 | |
| 368 | static void transformUUID(const UUID & src_uuid, UUID & dst_uuid, UInt64 seed) |
| 369 | { |
| 370 | const UInt128 & src = src_uuid.toUnderType(); |
| 371 | UInt128 & dst = dst_uuid.toUnderType(); |
| 372 | |
| 373 | SipHash hash; |
| 374 | hash.update(seed); |
| 375 | hash.update(reinterpret_cast<const char *>(&src), sizeof(UUID)); |
| 376 | |
| 377 | /// Saving version and variant from an old UUID |
| 378 | hash.get128(reinterpret_cast<char *>(&dst)); |
| 379 | |
| 380 | dst.items[1] = (dst.items[1] & 0x1fffffffffffffffull) | (src.items[1] & 0xe000000000000000ull); |
| 381 | dst.items[0] = (dst.items[0] & 0xffffffffffff0fffull) | (src.items[0] & 0x000000000000f000ull); |
| 382 | } |
| 383 | |
| 384 | class FixedStringModel : public IModel |
| 385 | { |