From 00c0d78199fcfbbb20828be5e06fd2d271fa4c1e Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Sun, 24 Mar 2024 23:49:26 +0100 Subject: Initial commit --- deimos/core/id_name.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 deimos/core/id_name.h (limited to 'deimos/core/id_name.h') diff --git a/deimos/core/id_name.h b/deimos/core/id_name.h new file mode 100644 index 0000000..eb961ca --- /dev/null +++ b/deimos/core/id_name.h @@ -0,0 +1,21 @@ +#pragma once + +#include "deimos/core/base.h" +#include "deimos/core/hash.h" + +namespace deimos +{ + +struct IdName +{ + uint128 hash; + const char* name; + + explicit constexpr IdName(const char* name) : + hash{MurmurHash3_x64_128(name)}, + name{name} + {} +}; + +} // namespace deimos + -- cgit