|
Adbase
Adinf C++ base library V2
|
实现 SHA1 算法 More...
#include <Sha1.hpp>
Public Member Functions | |
| Sha1 () | |
| void | update (const std::string &s) |
| 给定一个需要编码的字符串 More... | |
| void | update (std::istream &is) |
| 给定一个需要编码的字符串 More... | |
| std::string | final () |
| 获取最终编码的字符串 More... | |
| void | final (char *result) |
| 获取最终编码的字符串 More... | |
Static Public Member Functions | |
| static std::string | from_file (const std::string &filename) |
| 直接给定文件进行 sha1 编码 More... | |
| static void | hmacSha1 (const char *key, size_t keylen, const char *msg, size_t msglen, char *out) |
实现 SHA1 算法
| adbase::Sha1::Sha1 | ( | ) |
Definition at line 214 of file Sha1.cpp.
References adbase::detail::reset().
| std::string adbase::Sha1::final | ( | ) |
获取最终编码的字符串
| none |
Definition at line 250 of file Sha1.cpp.
References adbase::detail::BLOCK_BYTES, adbase::detail::BLOCK_INTS, adbase::detail::buffer_to_block(), adbase::detail::reset(), and adbase::detail::transform().
Referenced by hmacSha1().
| void adbase::Sha1::final | ( | char * | result | ) |
获取最终编码的字符串
| result | 返回编码的结果(raw) |
| none |
Definition at line 295 of file Sha1.cpp.
References adbase::detail::BLOCK_BYTES, adbase::detail::BLOCK_INTS, adbase::detail::buffer_to_block(), adbase::detail::reset(), and adbase::detail::transform().
|
static |
直接给定文件进行 sha1 编码
| none |
Definition at line 337 of file Sha1.cpp.
References update().
|
static |
| void adbase::Sha1::update | ( | const std::string & | s | ) |
给定一个需要编码的字符串
Definition at line 221 of file Sha1.cpp.
Referenced by from_file(), and hmacSha1().
| void adbase::Sha1::update | ( | std::istream & | is | ) |
给定一个需要编码的字符串
Definition at line 229 of file Sha1.cpp.
References adbase::detail::BLOCK_BYTES, adbase::detail::BLOCK_INTS, adbase::detail::buffer_to_block(), and adbase::detail::transform().