summaryrefslogtreecommitdiff
path: root/protocols/Telegram/tdlib/td/td/telegram/misc.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Telegram/tdlib/td/td/telegram/misc.h')
-rw-r--r--protocols/Telegram/tdlib/td/td/telegram/misc.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/protocols/Telegram/tdlib/td/td/telegram/misc.h b/protocols/Telegram/tdlib/td/td/telegram/misc.h
index 37c91b76e8..bced1fd60f 100644
--- a/protocols/Telegram/tdlib/td/td/telegram/misc.h
+++ b/protocols/Telegram/tdlib/td/td/telegram/misc.h
@@ -1,5 +1,5 @@
//
-// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
+// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -36,6 +36,12 @@ bool is_empty_string(const string &str) TD_WARN_UNUSED_RESULT;
// checks whether a string could be a valid username
bool is_valid_username(Slice username);
+// checks whether a string can be set as a username
+bool is_allowed_username(Slice username);
+
+// calculates truncated MD5 hash of a string
+uint64 get_md5_string_hash(const string &str) TD_WARN_UNUSED_RESULT;
+
// calculates hash of list of uint64
int64 get_vector_hash(const vector<uint64> &numbers) TD_WARN_UNUSED_RESULT;
@@ -48,4 +54,8 @@ bool check_currency_amount(int64 amount);
// checks whether language code is valid for bot settings
Status validate_bot_language_code(const string &language_code);
+// returns 0-based indexes of strings matching the query by prefixes
+vector<int32> search_strings_by_prefix(const vector<string> &strings, const string &query, int32 limit,
+ bool return_all_for_empty_query, int32 &total_count);
+
} // namespace td