5 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
26 #include <dali/public-api/common/dali-common.h>
32 INITIAL_HASH_VALUE = 5381
36 * @brief Create a hash code for a string
37 * @param toHash string to hash
40 DALI_CORE_API std::size_t CalculateHash(const std::string& toHash);
43 * @brief Create a hash code for 2 strings combined.
44 * Allows a hash to be calculated without concatenating the strings and allocating any memory.
45 * @param string1 first string
46 * @param string2 second string
49 DALI_CORE_API std::size_t CalculateHash(const std::string& string1, const std::string& string2);
52 * @brief Create a hash code for a string
53 * @param toHash string to hash
54 * @param terminator character terminating the hashing
57 DALI_CORE_API std::size_t CalculateHash(const std::string& toHash, char terminator);
60 * @brief Create a hash code for a std::vector<std::uint8_t>
61 * @param toHash list of std::uint8_t to hash
64 DALI_CORE_API std::size_t CalculateHash(const std::vector<std::uint8_t>& toHash);