Files
Slnkdwf/Crypto/hash.h
Jos Groot Lipman 0b955c13b8 Crypto ook hmac_sha256 toegevoegd + base64/base32 encoding afgesplitst
svn path=/Slnkdwf/trunk/; revision=30449
2016-08-28 19:14:11 +00:00

29 lines
723 B
C++

// //////////////////////////////////////////////////////////
// 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;
};