MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sha1Test

Function sha1Test

app/redis-6.2.6/src/sha1.c:204–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202
203#define UNUSED(x) (void)(x)
204int sha1Test(int argc, char **argv, int accurate)
205{
206 SHA1_CTX ctx;
207 unsigned char hash[20], buf[BUFSIZE];
208 int i;
209
210 UNUSED(argc);
211 UNUSED(argv);
212 UNUSED(accurate);
213
214 for(i=0;i<BUFSIZE;i++)
215 buf[i] = i;
216
217 SHA1Init(&ctx);
218 for(i=0;i<1000;i++)
219 SHA1Update(&ctx, buf, BUFSIZE);
220 SHA1Final(hash, &ctx);
221
222 printf("SHA1=");
223 for(i=0;i<20;i++)
224 printf("%02x", hash[i]);
225 printf("\n");
226 return 0;
227}
228#endif

Callers

nothing calls this directly

Calls 4

SHA1InitFunction · 0.70
SHA1UpdateFunction · 0.70
SHA1FinalFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected