mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 11:14:58 -06:00
- fix Zstandard Sfx stuff -> SetNumberOfThreads() - fix formatting of XXH32Reg.cpp and XXH64Reg.cpp - add Blake2s hash to explorer context menu
45 lines
890 B
C++
45 lines
890 B
C++
// XXH64Reg.cpp
|
|
|
|
#include "StdAfx.h"
|
|
|
|
#define XXH_STATIC_LINKING_ONLY
|
|
#include "../../C/CpuArch.h"
|
|
#include "../../C/zstd/xxhash.h"
|
|
|
|
#include "../Common/MyCom.h"
|
|
|
|
#include "../7zip/Common/RegisterCodec.h"
|
|
|
|
class CXXH64Hasher:
|
|
public IHasher,
|
|
public CMyUnknownImp
|
|
{
|
|
XXH64_state_t *_ctx;
|
|
Byte mtDummy[1 << 7];
|
|
|
|
public:
|
|
CXXH64Hasher() { _ctx = XXH64_createState(); }
|
|
~CXXH64Hasher() { XXH64_freeState(_ctx); }
|
|
|
|
MY_UNKNOWN_IMP1(IHasher)
|
|
INTERFACE_IHasher(;)
|
|
};
|
|
|
|
STDMETHODIMP_(void) CXXH64Hasher::Init() throw()
|
|
{
|
|
XXH64_reset(_ctx, 0);
|
|
}
|
|
|
|
STDMETHODIMP_(void) CXXH64Hasher::Update(const void *data, UInt32 size) throw()
|
|
{
|
|
XXH64_update(_ctx, data, size);
|
|
}
|
|
|
|
STDMETHODIMP_(void) CXXH64Hasher::Final(Byte *digest) throw()
|
|
{
|
|
UInt64 val = XXH64_digest(_ctx);
|
|
SetUi64(digest, val);
|
|
}
|
|
|
|
REGISTER_HASHER(CXXH64Hasher, 0x204, "XXH64", 8)
|