MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / is_valid_hf_token

Function is_valid_hf_token

common/hf-cache.cpp:145–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145static bool is_valid_hf_token(const std::string & token) {
146 if (token.length() < 37 || token.length() > 256 ||
147 !string_starts_with(token, "hf_")) {
148 return false;
149 }
150 for (size_t i = 3; i < token.length(); ++i) {
151 if (!is_alphanum(token[i])) {
152 return false;
153 }
154 }
155 return true;
156}
157
158static bool is_valid_commit(const std::string & hash) {
159 return is_hex_string(hash, 40);

Callers 1

api_getFunction · 0.85

Calls 3

is_alphanumFunction · 0.85
lengthMethod · 0.80
string_starts_withFunction · 0.70

Tested by

no test coverage detected