The open source OpenXR runtime
at main 20 lines 411 B view raw
1// Copyright 2019, Collabora, Ltd. 2// SPDX-License-Identifier: BSL-1.0 3/*! 4 * @file 5 * @brief Hashing function. 6 * @author Jakob Bornecrantz <jakob@collabora.com> 7 * @ingroup aux_math 8 */ 9 10#include "math/m_api.h" 11#include <string> 12 13 14extern "C" size_t 15math_hash_string(const char *str_c, size_t length) 16{ 17 std::string str = std::string(str_c, length); 18 std::hash<std::string> str_hash; 19 return str_hash(str); 20}