Back to index

python3.2  3.2.2
Classes | Functions
encodings.hex_codec Namespace Reference

Classes

class  Codec
class  IncrementalEncoder
class  IncrementalDecoder
class  StreamWriter
class  StreamReader

Functions

def hex_encode
 Codec APIs.
def hex_decode
def getregentry

Detailed Description

Python 'hex_codec' Codec - 2-digit hex content transfer encoding.

This codec de/encodes from bytes to bytes and is therefore usable with
bytes.transform() and bytes.untransform().

Written by Marc-Andre Lemburg (mal@lemburg.com).

Function Documentation

Definition at line 46 of file hex_codec.py.

00046 
00047 def getregentry():
00048     return codecs.CodecInfo(
00049         name='hex',
00050         encode=hex_encode,
00051         decode=hex_decode,
00052         incrementalencoder=IncrementalEncoder,
00053         incrementaldecoder=IncrementalDecoder,
00054         streamwriter=StreamWriter,
00055         streamreader=StreamReader,
00056     )
def encodings.hex_codec.hex_decode (   input,
  errors = 'strict' 
)

Definition at line 18 of file hex_codec.py.

00018 
00019 def hex_decode(input, errors='strict'):
00020     assert errors == 'strict'
00021     return (binascii.a2b_hex(input), len(input))

Here is the caller graph for this function:

def encodings.hex_codec.hex_encode (   input,
  errors = 'strict' 
)

Codec APIs.

Definition at line 14 of file hex_codec.py.

00014 
00015 def hex_encode(input, errors='strict'):
00016     assert errors == 'strict'
00017     return (binascii.b2a_hex(input), len(input))

Here is the caller graph for this function: