openssl(sha)

霸姨

关注

阅读 20

2022-05-20

#include "stdafx.h"

#include <string.h>

#include <openssl/sha.h>

int main(int argc, char* argv[])

{

printf("Hello World!\n");

char buf[]="123456";

unsigned char md[50]={0};

SHA_CTX ctx;

SHA_Init(&ctx);

SHA_Update(&ctx,buf,strlen(buf));

// SHA_Update(&ctx,buf,strlen(buf));

int rs= SHA_Final(md,&ctx);

for (int i=0;i<20;i++)

{

printf("%.2X ",md[i]);

}

return 0;

}

精彩评论(0)

0 0 举报