MCPcopy Create free account
hub / github.com/git/git / encode_85

Function encode_85

base85.c:79–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79void encode_85(char *buf, const unsigned char *data, int bytes)
80{
81 say("encode 85");
82 while (bytes) {
83 unsigned acc = 0;
84 int cnt;
85 for (cnt = 24; cnt >= 0; cnt -= 8) {
86 unsigned ch = *data++;
87 acc |= ch << cnt;
88 if (--bytes == 0)
89 break;
90 }
91 say1(" %08x", acc);
92 for (cnt = 4; cnt >= 0; cnt--) {
93 int val = acc % 85;
94 acc /= 85;
95 buf[cnt] = en85[val];
96 }
97 buf += 5;
98 }
99 say("\n");
100
101 *buf = 0;
102}
103
104#ifdef DEBUG_85
105int main(int ac, char **av)

Callers 2

emit_binary_diff_bodyFunction · 0.85
mainFunction · 0.85

Calls 1

sayFunction · 0.85

Tested by

no test coverage detected