-
Notifications
You must be signed in to change notification settings - Fork 1
/
INSTALL
103 lines (70 loc) · 2.69 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
----------------------------------------
PLAIN INSTALL
----------------------------------------
EXPORT CFLAGS='your optimization flags'
gcc defaults to "-O2 -g" you probably want "-O3 -Wall"
./configure
make
make test
make install
will produce a shared and static library and put in the right places.
it will also install the include files.
----------------------------------------
CHANGING THE b64 web/url SAFE ALPHABET
----------------------------------------
If you are using base 64 encoding for use IN A URL, you
CAN NOT use the standard mod_b64. You MUST use modp_b64w
(the w is for "web"). Unfortunately this is not standardized
and if you are working with a third party, you might need to
change the "alphabet" (chars).
You can change char 62,63 and the padding char with
./configure --with-b64wchars='-_.'
where "-" is char 62, "_" is char 63 and "." is the padding char.
You can change this if you know what you are doing.
----------------------------------------
IF YOU DON'T WANT TO DEAL WITH A LIBRARY
----------------------------------------
Base64 and base85 functions are so small, you might just want to
directly add them into your existing project. That's fine, it's all
under the BSD license, so go ahead.
For b64:
--------
After doing a "./configure && make", copy
* src/modp_b64.c
* src/modp_b64.h
* modp_b64_data.h
***** BUT, there is an IMPORTANT GOTCHA! *****
This code has special versions that are -endian- dependant. This
means different code is used on an Intel CPU than it is on a Motorola,
IBM, or Sun CPU.
**** IF you are using autoconf, just add AC_C_BIGENDIAN to your
configure.in script and everything will work.
**** IF NOT, edit modp_b64.c, and replace the
#include "config.h"
with
#define WORDS_BIGENDIAN /* for Sun, Ibm, Motorola */
OR
#undef WORDS_BIGENDIAN /* For intel, amd */
see the source code for details. Likewise you can pass in
-DWORDS_BIGENDIAN or -DNWORDS_BIGENDIAN during compilation.
For b85:
--------
There are no endian issues. Just copy
* src/modp_b85.c
* src/modp_b85.h
* modp_b85_data.h
----------------------------------------
UNIT TESTS
----------------------------------------
Two unit tests are included that are not installed. They are built
automatically and can be run with "make test"
./speedtest tests performance of b64 and b85
./unittest tests correctness of b64
./b85test test correectness of b75
If you are changing the base64 alphabet, just edit the b64gen.c program
and type 'make'.
If you are changing the base85 alphabet, edit the b85gen.c program and
type 'make'.
ALWAYS UNIT TEST ANY CHANGES. The current unittests depend on the
standard alphabet, so you might need to tweek them if to make custom
alterations.