MCPcopy Create free account
hub / github.com/carbonengine/trinity / getHash

Method getHash

shadercompiler/md5.cpp:323–340  ·  view source on GitHub ↗

return latest hash as 32 hex characters

Source from the content-addressed store, hash-verified

321
322/// return latest hash as 32 hex characters
323std::string MD5::getHash()
324{
325 // compute hash (as raw bytes)
326 unsigned char rawHash[HashBytes];
327 getHash( rawHash );
328
329 // convert to hex string
330 std::string result;
331 result.reserve( 2 * HashBytes );
332 for( int i = 0; i < HashBytes; i++ )
333 {
334 static const char dec2hex[16 + 1] = "0123456789abcdef";
335 result += dec2hex[( rawHash[i] >> 4 ) & 15];
336 result += dec2hex[rawHash[i] & 15];
337 }
338
339 return result;
340}
341
342
343/// return latest hash as bytes

Callers 1

GetSourceHashFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected