Package COM.INFORMATIMAGO.COMMON-LISP.DATA-ENCODING.HEXADECIMAL


This package exports functions to encode and decode byte vector buffer
into hexadecimal strings.


License:

    AGPL3

    Copyright Pascal J. Bourguignon 2013 - 2013

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.
    If not, see <http://www.gnu.org/licenses/>

(bytes-from-hexadecimal-string string &key element-type padding byte-sex case)
function

ELEMENT-TYPE: The element-type of the BYTE-VECTOR (if NIL, then
              (unsigned-byte 8) is used).

PADDING:      When NIL, the number of hexadecimal digits per byte is
              the minimum required (a vector of (unsigned-byte 3)
              would use one hexadecimal digit per element).  Otherwise
              it's at least PADDING.

BYTE-SEX:     When more than one octet are needed to store the bytes,
              they're ordered according to the byte-sex:

                 :big-endian    most significant octets first.
                 :little-endian least significant octets first.

              Notice that the quads in the octets are always stored first.

RETURN:       A string containing the hexadecimal digits representing the vector.

(bytes-to-hexadecimal-string byte-vector &key element-type padding byte-sex case)
function

ELEMENT-TYPE: The element-type of the BYTE-VECTOR (if NIL, then
              (ARRAY-ELEMENT-TYPE BYTE-VECTOR) is used.

PADDING:      When NIL, the number of hexadecimal digits per byte is
              the minimum required (a vector of (unsigned-byte 3)
              would use one hexadecimal digit per element).  Otherwise
              it's at least PADDING.

BYTE-SEX:     When more than one octet are needed to store the bytes,
              they're ordered according to the byte-sex:

                 :big-endian    most significant octets first.
                 :little-endian least significant octets first.

              Notice that the quads in the octets are always stored first.

RETURN:       A string containing the hexadecimal digits representing the vector.