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>
27 #include <dali/public-api/common/dali-vector.h>
33 INITIAL_HASH_VALUE = 5381
37 * @brief Create a hash code for a string
38 * @param toHash string to hash
41 DALI_CORE_API std::size_t CalculateHash(const std::string& toHash);
44 * @brief Create a hash code for 2 strings combined.
45 * Allows a hash to be calculated without concatenating the strings and allocating any memory.
46 * @param string1 first string
47 * @param string2 second string
50 DALI_CORE_API std::size_t CalculateHash(const std::string& string1, const std::string& string2);
53 * @brief Create a hash code for a string
54 * @param toHash string to hash
55 * @param terminator character terminating the hashing
58 DALI_CORE_API std::size_t CalculateHash(const std::string& toHash, char terminator);
61 * @brief Create a hash code for a std::vector<std::uint8_t>
62 * @param toHash list of std::uint8_t to hash
65 DALI_CORE_API std::size_t CalculateHash(const std::vector<std::uint8_t>& toHash);
68 * @brief Create a hash code for a Dali::Vector<std::uint8_t>
69 * @param toHash list of std::uint8_t to hash
72 DALI_CORE_API std::size_t CalculateHash(const Dali::Vector<std::uint8_t>& toHash);