summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools/base64.h
blob: 748b5d95208fc0ef0b9d46a70c49174a91bc7f2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Copyright (C) 2015-2016 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */

#ifndef BASE64_H
#define BASE64_H

#include <resolv.h>

#define b64_len(len) ((((len) + 2) / 3) * 4 + 1)

#ifndef b64_ntop
int b64_ntop(unsigned char const *, size_t, char *, size_t);
#define NEED_B64_NTOP
#endif

#ifndef b64_pton
int b64_pton(char const *, unsigned char *, size_t);
#define NEED_B64_PTON
#endif

#endif