MCPcopy Index your code
hub / github.com/assaultcube/AC / hex2bin

Function hex2bin

source/src/crypto.cpp:536–547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534}
535
536int hex2bin(uchar *d, const char *s, int maxlen)
537{
538 memset(d, 0, maxlen);
539 int len;
540 for(len = 0; s[len] && len < maxlen * 2; len++)
541 {
542 const char *hd = strchr(hexdigits, tolower(s[len]));
543 if(!hd) break; // -> not a hex digit
544 d[len / 2] |= (hd - hexdigits) << ((len & 1) ? 0 : 4);
545 }
546 return len / 2;
547}
548
549/////////////////////////////////////////////// Ed25519: high-speed high-security signatures //////////////////////////////////////////////////////
550

Callers 7

parsevitasFunction · 0.85
ed25519testFunction · 0.85
authsetupFunction · 0.85
authkeyMethod · 0.85
parseMethod · 0.85
crypto.cppFile · 0.85
initserverFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected