1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/lib/freebl/mpi/doc/basecvt.pod Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,65 @@ 1.4 +# This Source Code Form is subject to the terms of the Mozilla Public 1.5 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.7 + 1.8 +=head1 NAME 1.9 + 1.10 + basecvt - radix conversion for arbitrary precision integers 1.11 + 1.12 +=head1 SYNOPSIS 1.13 + 1.14 + basecvt <ibase> <obase> [values] 1.15 + 1.16 +=head1 DESCRIPTION 1.17 + 1.18 +The B<basecvt> program is a command-line tool for converting integers 1.19 +of arbitrary precision from one radix to another. The current version 1.20 +supports radix values from 2 (binary) to 64, inclusive. The first two 1.21 +command line arguments specify the input and output radix, in base 10. 1.22 +Any further arguments are taken to be integers notated in the input 1.23 +radix, and these are converted to the output radix. The output is 1.24 +written, one integer per line, to standard output. 1.25 + 1.26 +When reading integers, only digits considered "valid" for the input 1.27 +radix are considered. Processing of an integer terminates when an 1.28 +invalid input digit is encountered. So, for example, if you set the 1.29 +input radix to 10 and enter '10ACF', B<basecvt> would assume that you 1.30 +had entered '10' and ignore the rest of the string. 1.31 + 1.32 +If no values are provided, no output is written, but the program 1.33 +simply terminates with a zero exit status. Error diagnostics are 1.34 +written to standard error in the event of out-of-range radix 1.35 +specifications. Regardless of the actual values of the input and 1.36 +output radix, the radix arguments are taken to be in base 10 (decimal) 1.37 +notation. 1.38 + 1.39 +=head1 DIGITS 1.40 + 1.41 +For radices from 2-10, standard ASCII decimal digits 0-9 are used for 1.42 +both input and output. For radices from 11-36, the ASCII letters A-Z 1.43 +are also included, following the convention used in hexadecimal. In 1.44 +this range, input is accepted in either upper or lower case, although 1.45 +on output only lower-case letters are used. 1.46 + 1.47 +For radices from 37-62, the output includes both upper- and lower-case 1.48 +ASCII letters, and case matters. In this range, case is distinguished 1.49 +both for input and for output values. 1.50 + 1.51 +For radices 63 and 64, the characters '+' (plus) and '/' (forward 1.52 +solidus) are also used. These are derived from the MIME base64 1.53 +encoding scheme. The overall encoding is not the same as base64, 1.54 +because the ASCII digits are used for the bottom of the range, and the 1.55 +letters are shifted upward; however, the output will consist of the 1.56 +same character set. 1.57 + 1.58 +This input and output behaviour is inherited from the MPI library used 1.59 +by B<basecvt>, and so is not configurable at runtime. 1.60 + 1.61 +=head1 SEE ALSO 1.62 + 1.63 + dec2hex(1), hex2dec(1) 1.64 + 1.65 +=head1 AUTHOR 1.66 + 1.67 + Michael J. Fromberger <sting@linguist.dartmouth.edu> 1.68 + Thayer School of Engineering, Hanover, New Hampshire, USA