File: basez.1

package info (click to toggle)
basez 1.6.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 460 kB
  • sloc: ansic: 1,751; sh: 449; makefile: 14
file content (207 lines) | stat: -rw-r--r-- 6,902 bytes parent folder | download
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.8.
.TH BASEZ "1" "October 2019" "BaseZ 1.6.2" "User Commands"
.SH NAME
basez \- base 16/32/64 encode/decode data to standard output
.SH SYNOPSIS
.B basez
[\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]
.br
.B hex
[\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]
.br
.B unhex
[\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]
.br
.B base16
[\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]
.br
.B base32
[\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]
.br
.B base32plain
[\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]
.br
.B base32hex
[\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]
.br
.B base64
[\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]
.br
.B base64plain
[\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]
.br
.B base64url
[\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]
.br
.B base64mime
[\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]
.br
.B base64pem
[\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]
.SH DESCRIPTION
BaseZ encodes/decodes base16, base32, base32hex, base64 or base64url data
stream per RFC 4648; MIME base64 Content\-Transfer\-Encoding per RFC 2045;
or PEM Printable Encoding per RFC 1421.
.PP
Base16 encoding produces a multiple of two\-character blocks in hexadecimal
notation [0\-9a\-f]. It needs no padding and preserves the sort order of the
encoded data. Decoding is case insensitive.
.PP
Base32 encoded stream is a multiple of eight\-character blocks consisting of
letters and numbers [A\-Z2\-7]. Numbers easily confused with some letters
are skipped intentionally to make this encoding suitable for storage on \fB\-\-\fR
or transport over \fB\-\-\fR any medium or data transport mechanism, including
non\-case\-preserving barcodes or printed out strings that could be spelled
out and typed in by humans. If needed, the last encoded block is padded
with equal sign end padding. Appearance of the padding character [=] at the
end of the encoded steam can be avoided by encoding data of size divisible
by 5. Base32 decoding is case insensitive.
.PP
Base32hex encoding works the same way as base32 but with an alternative
character\-set [0\-9a\-v] to preserve the encoded data sort order.
This encoding should not be confused with base32.
.PP
Base64 encoded stream is a multiple of four\-character blocks using
uppercase letters, lowercase letters, numbers, plus and slash
[A\-Za\-z0\-9+/]. It uses equal sign [=] for end padding. Base64 decoding
is case sensitive. It has an option to convert local native text line
breaks into canonical CRLF sequences prior to encoding or to convert CRLF
sequences into native text line breaks after the decoding.
.PP
Base64url encoding is technically the same as base64 but instead of the
plus and slash signs [+/] it uses minus and underscore [\-_]. Appearance of
the padding character [=] in the encoded stream can be avoided by encoding
data of size divisible by 3.
.PP
Base64mime and base64pem are the same encodes as base64 but with encoded
stream line length limit of 76 and 64 characters respectively. PEM decoding
ignores all white and non\-printable characters; MIME decoding ignores
all characters outside of the encode character\-set.
.SH OPTIONS
When no FILE is specified or when FILE is \-, read standard input.
When multiple conflicting options appear, the last option wins.
.TP
\fB\-d\fR, \fB\-D\fR, \fB\-\-decode\fR
Decode.
By default ignore the space and newline characters.
The \fB\-\-strict\fR, \fB\-\-ignore\-all\-space\fR, and
\fB\-\-ignore\-garbage\fR options provide alternative behaviors.
Default option for unhex command.
.TP
\fB\-r\fR, \fB\-\-strict\fR
Do not ignore any characters outside of the encode
character\-set on decoding.
.TP
\fB\-s\fR, \fB\-\-ignore\-all\-space\fR
Ignore all white and non\-printable ASCII characters
on decoding. Default for base64pem decoding.
.TP
\fB\-g\fR, \fB\-\-ignore\-garbage\fR
Ignore all characters outside of the encode
character\-set on decoding. Default for
base64mime decoding.
.TP
\fB\-x\fR, \fB\-\-hex\fR, \fB\-\-base16\fR
Base16 coding. Default for base16, hex and
unhex commands.
.TP
\fB\-j\fR, \fB\-\-base32\fR
Base32 coding. Default for base32 and base32plain
commands.
.TP
\fB\-e\fR  \fB\-\-base32hex\fR
Base32hex coding. Default for base32hex command.
.TP
\fB\-c\fR, \fB\-\-capitals\fR, \fB\-\-upper\-case\fR
Output upper case letters on encoding, if applicable.
.TP
\fB\-l\fR, \fB\-\-lower\-case\fR
Output lower case letters on encoding, if applicable.
.TP
\fB\-a\fR, \fB\-\-base64\fR
Base64 coding. Default for basez, base64 and
base64plain commands.
.TP
\fB\-u\fR, \fB\-\-base64url\fR
Base64url coding. Default for base64url command.
.TP
\fB\-p\fR, \fB\-\-base64pem\fR
PEM printable coding. Default for base64pem command.
.TP
\fB\-m\fR, \fB\-\-base64mime\fR
MIME base64 coding. Default for base64mime command.
.TP
\fB\-t\fR, \fB\-\-text\fR
Convert native text line breaks into CRLF sequences
prior to encoding or convert CRLF sequences into
native text line breaks after decoding. This option
applies to all variants of base64 codings.
.TP
\fB\-w\fR N, \fB\-b\fR N, \fB\-\-wrap\fR=\fI\,N\/\fR, \fB\-\-break\fR=\fI\,N\/\fR
Set encoded stream line length limit to N characters.
The default value is 76 for base64mime encode, 64 for
base64pem encode, infinity for all other encodes.
To disable any appearance of EOL characters in the
encoded stream, set to 0.
.TP
\fB\-i\fR FILEIN, \fB\-\-input\fR=\fI\,FILEIN\/\fR
Input file. Default is standard input.
When FILEIN is \-, read stdin.
.TP
\fB\-o\fR FILEOUT, \fB\-\-output\fR=\fI\,FILEOUT\/\fR
Output file. Default is standard output.
When FILEOUT is \-, write to stdout.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display help.
.TP
\fB\-\-version\fR
Display program version information.
.SH EXAMPLES
Base16 decode a string:
.IP
echo 4a6f650a | hex \-\-decode
.PP
Inspect output of a command:
.IP
echo Joe | hex \-\-wrap 2
.PP
Base32 encode a string:
.IP
printf "Hi People\en" | base32plain
.PP
MIME base64 encode a binary file to stdout per RFC 2045:
.IP
base64mime FILE
.PP
MIME base64 encode a text file to stdout per RFC 2045:
.IP
base64mime \-\-text FILE
.PP
Base64 encode a file per RFC 4648
.IP
base64plain FILE > base64.rfc4648.file
.SH AUTHOR
Written by Milan Kupcevic.
.SH "REPORTING BUGS"
Report bugs to <bug\-basez@quarkline.net> with a 'bug:' somewhere in the subject line.
.PP
.br
These commands are parts of the BaseZ software package.
.TP
[BaseZ]
<http://www.quarkline.net/basez>
.SH COPYRIGHT
Copyright \(co 2013, 2015, 2016  Milan Kupcevic.
This program comes with ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. This program is licensed under the
terms of the GNU GPL version 3 or any later version as published by the Free
Software Foundation. User documentation is alternatively licensed under the
Creative Commons Attribution\-ShareAlike license version 3 or a later
version as published by the Creative Commons Corporation.
.SH "SEE ALSO"
.PP
.BR base64 (1),
.BR base32 (1),
.BR uuencode (1),
.BR uudecode (1)