MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / tp_a85

Function tp_a85

tests/test_doc_links_pdf.c:533–548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

531}
532
533static void tp_a85(tp_buf_t *b, const unsigned char *s, size_t n) {
534 tp_puts(b, "<~");
535 for (size_t i = 0; i < n; i += 4) {
536 unsigned char g[4] = {0, 0, 0, 0};
537 size_t k = n - i < 4 ? n - i : 4;
538 memcpy(g, s + i, k);
539 uint32_t v = ((uint32_t)g[0] << 24) | ((uint32_t)g[1] << 16) | ((uint32_t)g[2] << 8) | g[3];
540 char out[5];
541 for (int j = 4; j >= 0; j--) {
542 out[j] = (char)('!' + v % 85);
543 v /= 85;
544 }
545 tp_put(b, out, k + 1);
546 }
547 tp_puts(b, "~>");
548}
549
550TEST(pdf_extract_filters_and_hostile) {
551 size_t len;

Callers 1

Calls 2

tp_putsFunction · 0.85
tp_putFunction · 0.85

Tested by

no test coverage detected