1BASEZ(1)                         User Commands                        BASEZ(1)
2
3
4

NAME

6       basez - base 16/32/64 encode/decode data to standard output
7

SYNOPSIS

9       basez [OPTION]... [FILE]
10       hex [OPTION]... [FILE]
11       unhex [OPTION]... [FILE]
12       base16 [OPTION]... [FILE]
13       base32 [OPTION]... [FILE]
14       base32plain [OPTION]... [FILE]
15       base32hex [OPTION]... [FILE]
16       base64 [OPTION]... [FILE]
17       base64plain [OPTION]... [FILE]
18       base64url [OPTION]... [FILE]
19       base64mime [OPTION]... [FILE]
20       base64pem [OPTION]... [FILE]
21

DESCRIPTION

23       BaseZ  encodes/decodes  base16,  base32, base32hex, base64 or base64url
24       data stream per RFC 4648; MIME base64 Content-Transfer-Encoding per RFC
25       2045; or PEM Printable Encoding per RFC 1421.
26
27       Base16 encoding produces a multiple of two-character blocks in hexadec‐
28       imal notation [0-9a-f]. It needs no padding and preserves the sort  or‐
29       der of the encoded data. Decoding is case insensitive.
30
31       Base32  encoded stream is a multiple of eight-character blocks consist‐
32       ing of letters and numbers [A-Z2-7]. Numbers easily confused with  some
33       letters  are  skipped  intentionally to make this encoding suitable for
34       storage on -- or transport over -- any medium or data transport  mecha‐
35       nism,  including  non-case-preserving  barcodes  or printed out strings
36       that could be spelled out and typed in by humans. If needed,  the  last
37       encoded  block is padded with equal sign end padding. Appearance of the
38       padding character [=] at the end of the encoded steam can be avoided by
39       encoding  data of size divisible by 5. Base32 decoding is case insensi‐
40       tive.
41
42       Base32hex encoding works the same way as base32 but witn an alternative
43       character-set  [0-9a-v]  to preserve the encoded data sort order.  This
44       encoding should not be confused with base32.
45
46       Base64 encoded stream is a multiple of four-character blocks using  up‐
47       percase   letters,   lowercase   letters,   numbers,   plus  and  slash
48       [A-Za-z0-9+/]. It uses equal sign [=] for end padding. Base64  decoding
49       is  case  sensitive. It has an option to convert local native text line
50       breaks into canonical CRLF sequences prior to encoding  or  to  convert
51       CRLF sequences into native text line breaks after the decoding.
52
53       Base64url encoding is technically the same as base64 but instead of the
54       plus and slash signs [+/] it uses minus and underscore [-_]. Appearance
55       of  the  padding  character [=] in the encoded stream can be avoided by
56       encoding data of size divisible by 3.
57
58       Base64mime and base64pem are the same encodes as base64  but  with  en‐
59       coded  stream  line  length limit of 76 and 64 characters respectively.
60       PEM decoding ignores all white and non-printable characters;  MIME  de‐
61       coding ignores all characters outside of the encode character-set.
62

OPTIONS

64       When no FILE is specified or when FILE is -, read standard input.  When
65       multiple conflicting options appear, the last option wins.
66
67       -d, -D, --decode
68              Decode.  By default ignore the  space  and  newline  characters.
69              The  --strict,  --ignore-all-space, and --ignore-garbage options
70              provide alternative behaviors.  Default option  for  unhex  com‐
71              mand.
72
73       -r, --strict
74              Do not ignore any characters outside of the encode character-set
75              on decoding.
76
77       -s, --ignore-all-space
78              Ignore all white and non-printable ASCII characters on decoding.
79              Default for base64pem decoding.
80
81       -g, --ignore-garbage
82              Ignore all characters outside of the encode character-set on de‐
83              coding. Default for base64mime decoding.
84
85       -x, --hex, --base16
86              Base16 coding. Default for base16, hex and unhex commands.
87
88       -j, --base32
89              Base32 coding. Default for base32 and base32plain commands.
90
91       -e  --base32hex
92              Base32hex coding. Default for base32hex command.
93
94       -c, --capitals, --upper-case
95              Output upper case letters on encoding, if applicable.
96
97       -l, --lower-case
98              Output lower case letters on encoding, if applicable.
99
100       -a, --base64
101              Base64 coding. Default for basez, base64  and  base64plain  com‐
102              mands.
103
104       -u, --base64url
105              Base64url coding. Default for base64url command.
106
107       -p, --base64pem
108              PEM printable coding. Default for base64pem command.
109
110       -m, --base64mime
111              MIME base64 coding. Default for base64mime command.
112
113       -t, --text
114              Convert native text line breaks into CRLF sequences prior to en‐
115              coding or convert CRLF sequences into native  text  line  breaks
116              after  decoding.  This  option applies to all variants of base64
117              codings.
118
119       -w N, -b N, --wrap=N, --break=N
120              Set encoded stream line length limit to N characters.   The  de‐
121              fault  value  is  76 for base64mime encode, 64 for base64pem en‐
122              code, infinity for all other encodes.  To disable any appearance
123              of EOL characters in the encoded stream, set to 0.
124
125       -i FILEIN, --input=FILEIN
126              Input  file.  Default is standard input.  When FILEIN is -, read
127              stdin.
128
129       -o FILEOUT, --output=FILEOUT
130              Output file. Default is standard output.   When  FILEOUT  is  -,
131              write to stdout.
132
133       -h, --help
134              Display help.
135
136       --version
137              Display program version information.
138

EXAMPLES

140       Base16 decode a string:
141
142              echo 4a6f650a | hex --decode
143
144       Inspect output of a command:
145
146              echo Joe | hex --wrap 2
147
148       Base32 encode a string:
149
150              printf "Hi People\n" | base32plain
151
152       MIME base64 encode a binary file to stdout per RFC 2045:
153
154              base64mime FILE
155
156       MIME base64 encode a text file to stdout per RFC 2045:
157
158              base64mime --text FILE
159
160       Base64 encode a file per RFC 4648
161
162              base64plain FILE > base64.rfc4648.file
163

AUTHOR

165       Written by Milan Kupcevic.
166

REPORTING BUGS

168       Report bugs to <bug-basez@quarkline.net> with a 'bug:' somewhere in the
169       subject line.
170
171       These commands are parts of the BaseZ software package.
172
173       [BaseZ]
174              <http://www.quarkline.net/basez>
175
177       Copyright © 2013, 2015, 2016  Milan Kupcevic.  This program comes  with
178       ABSOLUTELY  NO  WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A
179       PARTICULAR PURPOSE. This program is licensed under the terms of the GNU
180       GPL  version  3  or any later version as published by the Free Software
181       Foundation. User documentation is alternatively licensed under the Cre‐
182       ative  Commons Attribution-ShareAlike license version 3 or a later ver‐
183       sion as published by the Creative Commons Corporation.
184

SEE ALSO

186       base64(1), base32(1), uuencode(1), uudecode(1)
187
188
189
190BaseZ 1.6.2                      October 2019                         BASEZ(1)
Impressum