1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2024-11-29 01:33:46 +00:00

Enable uppercase hash-to-string conversion.

This commit is contained in:
King_DuckZ 2015-11-27 20:34:42 +00:00
parent 51d0bfdf7a
commit e957fde12c
2 changed files with 5 additions and 2 deletions

View file

@ -103,8 +103,11 @@ namespace din {
parSizeOut = static_cast<uint64_t>(file_size);
}
std::string tiger_to_string (const TigerHash& parHash) {
std::string tiger_to_string (const TigerHash& parHash, bool parUpcase) {
std::ostringstream oss;
if (parUpcase) {
oss << std::uppercase;
}
oss << std::hex << std::setfill('0') << std::setw(2 * sizeof(uint64_t))
<< swap_long(parHash.part_a)
<< std::hex << std::setfill('0') << std::setw(2 * sizeof(uint64_t))

View file

@ -41,7 +41,7 @@ namespace din {
void tiger_file ( const std::string& parPath, TigerHash& parHashFile, TigerHash& parHashDir, uint64_t& parSizeOut );
void tiger_init_hash ( TigerHash& parHash );
std::string tiger_to_string ( const TigerHash& parHash );
std::string tiger_to_string ( const TigerHash& parHash, bool parUpcase=false );
void tiger_data ( const std::string& parData, TigerHash& parHash );
void tiger_data ( const std::vector<char>& parData, TigerHash& parHash );
} //namespace din