Blender V5.0
BKE_anonymous_attribute_make.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <fmt/format.h>
10#include <sstream>
11#include <xxhash.h>
12
13namespace blender::bke {
14
15template<typename... Args> inline std::string hash_to_anonymous_attribute_name(Args &&...args)
16{
17 std::stringstream ss;
18 ((ss << args), ...);
19 const std::string long_name = ss.str();
20 const XXH128_hash_t hash = XXH3_128bits(long_name.c_str(), long_name.size());
21 return fmt::format(".a_{:x}{:x}", hash.low64, hash.high64);
22}
23
24} // namespace blender::bke
std::string hash_to_anonymous_attribute_name(Args &&...args)
#define hash
Definition noise_c.cc:154