Commit 5495424b authored by Niels Möller's avatar Niels Möller

Deleted old #if:ed out base64_encode function.

parent ccc22299
2015-02-09 Niels Möller <nisse@lysator.liu.se>
* base64-encode.c (base64_encode): Deleted old #if:ed out
function.
* testsuite/base64-test.c (test_fuzz_once, test_fuzz): Additional
tests, based on contribution by Amos Jeffries.
......
......@@ -87,50 +87,6 @@ base64_encode_raw(uint8_t *dst, size_t length, const uint8_t *src)
assert(out == dst);
}
#if 0
unsigned
base64_encode(uint8_t *dst,
unsigned src_length,
const uint8_t *src)
{
unsigned dst_length = BASE64_ENCODE_RAW_LENGTH(src_length);
unsigned n = src_length / 3;
unsigned left_over = src_length % 3;
unsigned done = 0;
if (left_over)
{
const uint8_t *in = src + n * 3;
uint8_t *out = dst + dst_length;
switch(left_over)
{
case 1:
*--out = '=';
*--out = ENCODE(in[0] << 4);
break;
case 2:
*--out = ENCODE( in[1] << 2);
*--out = ENCODE((in[0] << 4) | (in[1] >> 4));
break;
default:
abort();
}
*--out = ENCODE(in[0] >> 2);
done = 4;
}
base64_encode_raw(n, dst, src);
done += n * 4;
assert(done == dst_length);
return done;
}
#endif
void
base64_encode_group(uint8_t *dst, uint32_t group)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment