MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / SHA1

Function SHA1

tools/websocket_to_posix_proxy/src/sha1.cpp:282–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282void SHA1(
283 char *hash_out,
284 const char *str,
285 int len)
286{
287 SHA1_CTX ctx;
288 int ii;
289
290 SHA1Init(&ctx);
291 for (ii=0; ii<len; ii+=1)
292 SHA1Update(&ctx, (const unsigned char*)str + ii, 1);
293 SHA1Final((unsigned char *)hash_out, &ctx);
294 hash_out[20] = '\0';
295}

Callers 1

SendHandshakeFunction · 0.85

Calls 3

SHA1InitFunction · 0.85
SHA1UpdateFunction · 0.85
SHA1FinalFunction · 0.85

Tested by

no test coverage detected