MCPcopy Create free account
hub / github.com/acl-dev/acl / hex_encode

Method hex_encode

lib_acl_cpp/src/stdlib/md5.cpp:337–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335#define UCHAR_PTR(x) ((const unsigned char *)(x))
336
337const char* md5::hex_encode(const void* in, size_t len, char* out, size_t size)
338{
339 // size ��������Ӧ��Ϊ: len * 2 + 1
340 if (size < 2 * len + 1) {
341 abort();
342 }
343
344 const unsigned char *cp;
345 int ch;
346 size_t count, i = 0;
347
348 for (cp = UCHAR_PTR(in), count = len; count > 0; count--, cp++) {
349 ch = *cp;
350 out[i++] = hex_chars[(ch >> 4) & 0xf];
351 out[i++] = hex_chars[ch & 0xf];
352 }
353
354 out[i] = 0;
355 return out;
356}
357
358} // namespace acl

Callers 2

http_header.cppFile · 0.80
get_stringMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected