diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-05-01 16:24:15 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-05-01 16:24:15 +0200 |
commit | a30ba67504ffd12c4db499adbb5ce47a7d1f6036 (patch) | |
tree | 9ae1a7e3849dda6bbb5c578232f6f2fa5b2e7e7e /spectro/base64.h | |
parent | 89e99e8a827859729729dfc92d74be4a8f96f1a4 (diff) | |
parent | 094535c010320967639e8e86f974d878e80baa72 (diff) |
New release 1.7.0
Diffstat (limited to 'spectro/base64.h')
-rw-r--r-- | spectro/base64.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spectro/base64.h b/spectro/base64.h new file mode 100644 index 0000000..726f20a --- /dev/null +++ b/spectro/base64.h @@ -0,0 +1,33 @@ + +/* + * Argyll Color Correction System + * + * Very simple & concise base64 encoder/decoder + * + * Author: Graeme W. Gill + * + * Copyright 2014, Graeme W. Gill + * All rights reserved. + * + * This material is licenced under the GNU GENERAL PUBLIC LICENSE Version 2 or later :- + * see the License2.txt file for licencing details. + */ + + +/* The maximum encoded length given decoded length */ +#define EBASE64LEN(len) (((len) * 4 + 2)/3) + +/* Encode slen bytes into nul terminated string. */ +/* if dlen is !NULL, then set it to resulting string length excluding nul */ +/* We assume that the destination buffer is long enough at EBASE64LEN */ +void ebase64(int *dlen, char *dst, unsigned char *src, int slen); + +/* The maximum decoded length given encoded length */ +#define DBASE64LEN(len) (((len) * 3)/4) + +/* Decode nul terminated string into bytes, ignoring illegal characters. */ +/* if dlen is !NULL, then set it to resulting byte length */ +/* We assume that the destination buffer is long enough at DBASE64LEN */ +void dbase64(int *dlen, unsigned char *dst, char *src); + + |