#pragma once #include #include namespace librs { namespace crypto { class HashStream { public: enum HashType { UNKNOWN = 0x00, SHA1 = 0x01 }; HashStream(HashType t); ~HashStream(); Sha1CheckSum hash() ; template friend HashStream& operator<<(HashStream& u, const T&) ; template friend HashStream& operator<<(HashStream& u,const t_RsGenericIdType& r) { EVP_DigestUpdate(u.mdctx,r.toByteArray(),ID_SIZE_IN_BYTES); return u; } private: EVP_MD_CTX *mdctx ; }; } }