#include <cpps/cpps.h>#include <iostream>#include <string>#include <fstream>using namespace cpps;using namespace std;#include "MD5.h"#include "sha1.h"#include "sha2.h"cpps_export_void cpps_attach(cpps::C* c){cpps::cpps_init_cpps_class(c);cpps::_module(c, "hashlib")[_class<MD5>("md5").def("constructor",&MD5::cpps_update).def("update",&MD5::cpps_update).def("hexdigest",&MD5::hex_digest).def("hexdigest16",&MD5::hex_digest16).def("digest",&MD5::raw_digest).def("update_file",&MD5::update_file),_class<CSHA1>("sha1").def("constructor",&CSHA1::cpps_update).def("update",&CSHA1::cpps_update).def("hexdigest",&CSHA1::hex_digest).def("digest",&CSHA1::digest).def("update_file",&CSHA1::update_file),_class<SHA224>("sha224").def("constructor",&SHA224::update).def("update",&SHA224::update).def("hexdigest",&SHA224::hex_digest).def("digest",&SHA224::digest).def("update_file",&SHA224::update_file),_class<SHA256>("sha256").def("constructor",&SHA256::update).def("update",&SHA256::update).def("hexdigest",&SHA256::hex_digest).def("digest",&SHA256::digest).def("update_file",&SHA256::update_file),_class<SHA384>("sha384").def("constructor",&SHA384::update).def("update",&SHA384::update).def("hexdigest",&SHA384::hex_digest).def("digest",&SHA384::digest).def("update_file",&SHA384::update_file),_class<SHA512>("sha512").def("constructor",&SHA512::update).def("update",&SHA512::update).def("digest",&SHA512::digest).def("hexdigest",&SHA512::hex_digest).def("update_file",&SHA512::update_file)];}cpps_export_void cpps_detach(cpps::C * c){cpps::_unmodule(c, "hashlib");}cpps_export_finish
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型