use GNUmakefile, since we depend on GNU stuff
[mkp224o.git] / base32.h
blob529afabf0f062516e5441115d443bdcb38070a66
1 // converts src[0:slen] to base32 string
2 char *base32_to(char *dst,const u8 *src,size_t slen);
3 // calculates length needed to store data converted to base32
4 #define BASE32_TO_LEN(l) (((l) * 8 + 4) / 5)
5 // converts src string from base32
6 size_t base32_from(u8 *dst,u8 *dmask,const char *src);
7 // calculates length needed to store data converted from base32
8 #define BASE32_FROM_LEN(l) (((l) * 5 + 7) / 8)
9 // validates base32 string and optionally stores length of valid data
10 // returns 1 if whole string is good, 0 if string contains invalid data
11 int base32_valid(const char *src,size_t *count);