From d82dc3a7824ba353e4f5d627abc96f6e4a90683c Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Thu, 13 Sep 2012 19:00:21 -0400 Subject: [PATCH] added hash template func --- include/fc/sha1.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/fc/sha1.hpp b/include/fc/sha1.hpp index 00279bc..e95ff15 100644 --- a/include/fc/sha1.hpp +++ b/include/fc/sha1.hpp @@ -19,6 +19,9 @@ namespace fc { static sha1 hash( const char* d, uint32_t dlen ); static sha1 hash( const fc::string& ); + template + static sha1 hash( const T& t ) { sha1::encoder e; e << t; return e.result(); } + class encoder { public: encoder();