MCPcopy Create free account
hub / github.com/defold/defold / CreateResourceHash

Function CreateResourceHash

engine/resource/src/resource_util.cpp:78–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78Result CreateResourceHash(dmLiveUpdateDDF::HashAlgorithm algorithm, const uint8_t* buf, size_t buflen, uint8_t* digest)
79{
80 if (algorithm == dmLiveUpdateDDF::HASH_MD5)
81 {
82 dmCrypt::HashMd5(buf, buflen, digest);
83 }
84 else if (algorithm == dmLiveUpdateDDF::HASH_SHA1)
85 {
86 dmCrypt::HashSha1(buf, buflen, digest);
87 }
88 else
89 {
90 dmLogError("The algorithm specified for manifest verification hashing is not supported (%i)", algorithm);
91 return RESULT_INVALID_DATA;
92 }
93 return RESULT_OK;
94}
95
96Result CreateManifestHash(dmLiveUpdateDDF::HashAlgorithm algorithm, const uint8_t* buf, size_t buflen, uint8_t* digest)
97{

Callers 2

VerifyResourceFunction · 0.85

Calls 2

HashMd5Function · 0.85
HashSha1Function · 0.85

Tested by

no test coverage detected