简体   繁体   English

安装C API(MD5)

[英]installing c api (md5)

I have learned from my previous question that I need to install a C API to get an md5 function. 我从上一个问题中学到,我需要安装C API才能获得md5函数。 However the file I have got from here does not have a readme. 但是,我从这里获得的文件没有自述文件。

I am a noob, I know I'm a noob, and I know loads of people will love to tell me how silly my question is, but I have googled on how to install C libraries, but most of the results turn up pages for C# and C++. 我是菜鸟,我知道我是菜鸟,并且我知道很多人都喜欢告诉我我的问题有多愚蠢,但是我已经在Google上搜索了如何安装C库,但是大多数结果都显示了C#和C ++。 How do I install the library, and importantly, without any documentation, how do I know how to use it? 如何安装该库,重要的是,没有任何文档,我如何知道如何使用它?

In this very case you can just type make on the command line, and it will automatically compile. 在这种情况下,您只需在命令行上键入make ,它将自动编译。 See this about the concept: http://tldp.org/LDP/LG/current/smith.html 请参阅有关此概念的内容: http : //tldp.org/LDP/LG/current/smith.html

If there's no documentation, you'll have to figure out yourself how the library works. 如果没有文档,则必须弄清楚该库是如何工作的。 By the way, in this specific case, it won't be horribly difficult. 顺便说一句,在这种特定情况下,这并不是很难。 Calculating an MD5 checksum is a very specific and very narrow task, so most likely all you will have to do is something like 计算MD5校验和是一项非常具体且非常狭窄的任务,因此您最可能要做的就是

void *data = // whatever
const char *md5_checksum = calculate_md5(data, length_of_data);

(pseudocode). (伪代码)。 Otherwise you can have a look at the header files of the library; 否则,您可以查看库的头文件。 a well-written library is self-documented, and the comments in the header file make it obvious to use. 一个写得很好的库是自记录的,并且头文件中的注释使它变得显而易见。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM