sha1函数在cpp(C ++) [英] sha1 function in cpp (C++)

查看:135
本文介绍了sha1函数在cpp(C ++)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从开始说我不知道​​任何关于c + +和我googled,没有什么可以让我明白如何使用C ++中的SHA1。通过目标C:SHA1 发现了这一点,但是它的目标并不确定它是一样的。 / p>

我需要执行以下操作:



我需要很多文件, make.sh和一个名为server.cpp的文件我需要在此部分插入的SHA1 info_hash:

  Csql_query(m_database, insert into @files(info_hash,mtime,ctime)
values(?,unix_timestamp(),unix_timestamp()))p(i.first).execute

所以我想我需要做以下sha1(?)。 ? isnt info_hash我需要。我认为它生成某处,?是一个变量。



所以请不要告诉我添加任何类或其他东西,因为我不明白如何做,如果我需要添加一些东西在。

解决方案

一个好的SHA1和其他函数的库是cryptopp。



这里是另一个问题,答案是cryptopp:快速跨平台C / C ++散列库


Ill start by saying I dont know anything about c++ and I googled, there is nothing that can make me understand how to use SHA1 in C++. found this one though Objective C: SHA1 but its about objective c im not sure it is the same.

I need to do the following:

I habve a lot of files, i compile them by doing ./make.sh and in one file called server.cpp I need to SHA1 info_hash thats inserted in this part:

Csql_query(m_database, "insert into @files (info_hash, mtime, ctime)
 values (?, unix_timestamp(), unix_timestamp())").p(i.first).execute();

so I kinda think I need to do the following sha1(?). "?" isnt info_hash i need. i think it generates somewhere and "?" is a variable.

so please dont tell me to add any classes or something else, because i do NOT understand how to do that, if i need to add something in the beggining of the file, please tell me so.

解决方案

A good library for SHA1 and other functions is cryptopp.

Here is another question where the answer is cryptopp: Fast Cross-Platform C/C++ Hashing Library

这篇关于sha1函数在cpp(C ++)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆