mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-06 17:15:00 -06:00
4.45 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
d9666cf046
commit
a145bfc7cf
27
CPP/7zip/Common/MethodId.cpp
Executable file
27
CPP/7zip/Common/MethodId.cpp
Executable file
@@ -0,0 +1,27 @@
|
||||
// MethodID.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "MethodID.h"
|
||||
#include "../../Common/String.h"
|
||||
|
||||
static inline wchar_t GetHex(Byte value)
|
||||
{
|
||||
return (wchar_t)((value < 10) ? ('0' + value) : ('A' + (value - 10)));
|
||||
}
|
||||
|
||||
UString ConvertMethodIdToString(UInt64 id)
|
||||
{
|
||||
wchar_t s[32];
|
||||
int len = 32;
|
||||
s[--len] = 0;
|
||||
do
|
||||
{
|
||||
s[--len] = GetHex((Byte)id & 0xF);
|
||||
id >>= 4;
|
||||
s[--len] = GetHex((Byte)id & 0xF);
|
||||
id >>= 4;
|
||||
}
|
||||
while (id != 0);
|
||||
return s + len;
|
||||
}
|
||||
Reference in New Issue
Block a user