MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / HashFile

Function HashFile

native/thirdpart/flatbuffers/idl_parser.cpp:3250–3259  ·  view source on GitHub ↗

Generate a unique hash for a file based on its name and contents (if any).

Source from the content-addressed store, hash-verified

3248
3249// Generate a unique hash for a file based on its name and contents (if any).
3250static uint64_t HashFile(const char *source_filename, const char *source) {
3251 uint64_t hash = 0;
3252
3253 if (source_filename)
3254 hash = HashFnv1a<uint64_t>(StripPath(source_filename).c_str());
3255
3256 if (source && *source) hash ^= HashFnv1a<uint64_t>(source);
3257
3258 return hash;
3259}
3260
3261CheckedError Parser::DoParse(const char *source, const char **include_paths,
3262 const char *source_filename,

Callers 1

DoParseMethod · 0.85

Calls 2

StripPathFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected