mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-08 16:07:04 -06:00
Make Upper- or lowercase hash output an option. (fix #177)
This commit is contained in:
@@ -9,6 +9,10 @@
|
||||
#include "../../Common/FileStreams.h"
|
||||
#include "../../Common/StreamUtils.h"
|
||||
|
||||
#ifdef WANT_OPTIONAL_LOWERCASE
|
||||
#include "../FileManager/RegistryUtils.h"
|
||||
#endif
|
||||
|
||||
#include "EnumDirItems.h"
|
||||
#include "HashCalc.h"
|
||||
|
||||
@@ -309,10 +313,15 @@ HRESULT HashCalc(
|
||||
return callback->AfterLastFile(hb);
|
||||
}
|
||||
|
||||
|
||||
static inline char GetHex(unsigned v)
|
||||
{
|
||||
return (char)((v < 10) ? ('0' + v) : ('a' + (v - 10)));
|
||||
#ifdef WANT_OPTIONAL_LOWERCASE
|
||||
if (WantLowercaseHashes())
|
||||
{
|
||||
return (char)((v < 10) ? ('0' + v) : ('a' + (v - 10)));
|
||||
}
|
||||
#endif
|
||||
return (char)((v < 10) ? ('0' + v) : ('A' + (v - 10)));
|
||||
}
|
||||
|
||||
void AddHashHexToString(char *dest, const Byte *data, UInt32 size)
|
||||
|
||||
6
CPP/7zip/UI/Common/HashCalc2.cpp
Normal file
6
CPP/7zip/UI/Common/HashCalc2.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
// HashCalc2.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#define WANT_OPTIONAL_LOWERCASE
|
||||
#include "HashCalc.cpp"
|
||||
Reference in New Issue
Block a user