2018-10-14 19:57:17 +08:00
|
|
|
#include <drogon/config.h>
|
2018-09-15 22:04:52 +08:00
|
|
|
#ifdef USE_OPENSSL
|
|
|
|
#include <openssl/sha.h>
|
|
|
|
#else
|
2018-10-14 19:57:17 +08:00
|
|
|
#include "../lib/src/ssl_funcs/Sha1.h"
|
2018-09-15 22:04:52 +08:00
|
|
|
#endif
|
|
|
|
#include <stdio.h>
|
2019-02-02 12:09:14 +08:00
|
|
|
#include <string.h>
|
|
|
|
|
2018-09-15 22:04:52 +08:00
|
|
|
int main()
|
|
|
|
{
|
2018-10-14 15:56:54 +08:00
|
|
|
unsigned char in[] = "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890";
|
|
|
|
unsigned char out[SHA_DIGEST_LENGTH] = {0};
|
2019-02-02 11:34:00 +08:00
|
|
|
SHA1(in, strlen((const char *)in), out);
|
|
|
|
/// fecfd28bbc9345891a66d7c1b8ff46e60192d284
|
2018-10-14 15:56:54 +08:00
|
|
|
for (int i = 0; i < SHA_DIGEST_LENGTH; i++)
|
|
|
|
printf("%02x", out[i]);
|
2018-09-15 22:04:52 +08:00
|
|
|
putchar('\n');
|
|
|
|
}
|