Initial import of libdpf.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
e4e666f459
4563 changed files with 1690372 additions and 0 deletions
28
thirdparty/hash-library/hash.h
vendored
Normal file
28
thirdparty/hash-library/hash.h
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// //////////////////////////////////////////////////////////
|
||||
// hash.h
|
||||
// Copyright (c) 2014,2015 Stephan Brumme. All rights reserved.
|
||||
// see http://create.stephan-brumme.com/disclaimer.html
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
/// abstract base class
|
||||
class Hash
|
||||
{
|
||||
public:
|
||||
/// compute hash of a memory block
|
||||
virtual std::string operator()(const void* data, size_t numBytes) = 0;
|
||||
/// compute hash of a string, excluding final zero
|
||||
virtual std::string operator()(const std::string& text) = 0;
|
||||
|
||||
/// add arbitrary number of bytes
|
||||
virtual void add(const void* data, size_t numBytes) = 0;
|
||||
|
||||
/// return latest hash as hex characters
|
||||
virtual std::string getHash() = 0;
|
||||
|
||||
/// restart
|
||||
virtual void reset() = 0;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue