security/nss/lib/freebl/mpi/doc/basecvt.pod

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 # This Source Code Form is subject to the terms of the Mozilla Public
     2 # License, v. 2.0. If a copy of the MPL was not distributed with this
     3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
     5 =head1 NAME
     7  basecvt - radix conversion for arbitrary precision integers
     9 =head1 SYNOPSIS
    11  basecvt <ibase> <obase> [values]
    13 =head1 DESCRIPTION
    15 The B<basecvt> program is a command-line tool for converting integers
    16 of arbitrary precision from one radix to another.  The current version
    17 supports radix values from 2 (binary) to 64, inclusive.  The first two
    18 command line arguments specify the input and output radix, in base 10.
    19 Any further arguments are taken to be integers notated in the input
    20 radix, and these are converted to the output radix.  The output is
    21 written, one integer per line, to standard output.
    23 When reading integers, only digits considered "valid" for the input
    24 radix are considered.  Processing of an integer terminates when an
    25 invalid input digit is encountered.  So, for example, if you set the
    26 input radix to 10 and enter '10ACF', B<basecvt> would assume that you
    27 had entered '10' and ignore the rest of the string.
    29 If no values are provided, no output is written, but the program
    30 simply terminates with a zero exit status.  Error diagnostics are
    31 written to standard error in the event of out-of-range radix
    32 specifications.  Regardless of the actual values of the input and
    33 output radix, the radix arguments are taken to be in base 10 (decimal)
    34 notation.
    36 =head1 DIGITS
    38 For radices from 2-10, standard ASCII decimal digits 0-9 are used for
    39 both input and output.  For radices from 11-36, the ASCII letters A-Z
    40 are also included, following the convention used in hexadecimal.  In
    41 this range, input is accepted in either upper or lower case, although
    42 on output only lower-case letters are used.
    44 For radices from 37-62, the output includes both upper- and lower-case
    45 ASCII letters, and case matters.  In this range, case is distinguished
    46 both for input and for output values.
    48 For radices 63 and 64, the characters '+' (plus) and '/' (forward
    49 solidus) are also used.  These are derived from the MIME base64
    50 encoding scheme.  The overall encoding is not the same as base64,
    51 because the ASCII digits are used for the bottom of the range, and the
    52 letters are shifted upward; however, the output will consist of the
    53 same character set.
    55 This input and output behaviour is inherited from the MPI library used
    56 by B<basecvt>, and so is not configurable at runtime.
    58 =head1 SEE ALSO
    60  dec2hex(1), hex2dec(1)
    62 =head1 AUTHOR
    64  Michael J. Fromberger <sting@linguist.dartmouth.edu>
    65  Thayer School of Engineering, Hanover, New Hampshire, USA

mercurial