def hexdump( src, length=<NUM_LIT:16>, sep='<STR_LIT:.>', start = <NUM_LIT:0>):
result = [];<EOL>try:<EOL><INDENT>xrange(<NUM_LIT:0>,<NUM_LIT:1>);<EOL><DEDENT>except NameError:<EOL><INDENT>xrange = range;<EOL><DEDENT>for i in xrange(<NUM_LIT:0>, len(src), length):<EOL><INDENT>subSrc = src[i:i+length];<EOL>hexa = '<STR_LIT>';<EOL>isMiddle = False;<EOL>for h in xrange(<NUM_LIT:0>,len(subSrc)):<EOL><INDENT>if h == length/<NUM_LIT:2>:<EOL><INDENT>hexa += '<STR_LIT:U+0020>';<EOL><DEDENT>h = subSrc[h];<EOL>if not isinstance(h, int):<EOL><INDENT>h = ord(h);<EOL><DEDENT>h = hex(h).replace('<STR_LIT>','<STR_LIT>');<EOL>if len(h) == <NUM_LIT:1>:<EOL><INDENT>h = '<STR_LIT:0>'+h;<EOL><DEDENT>hexa += h+'<STR_LIT:U+0020>';<EOL><DEDENT>hexa = hexa.strip('<STR_LIT:U+0020>');<EOL>text = '<STR_LIT>';<EOL>for c in subSrc:<EOL><INDENT>if not isinstance(c, int):<EOL><INDENT>c = ord(c);<EOL><DEDENT>if <NUM_LIT> <= c < <NUM_LIT>:<EOL><INDENT>text += chr(c);<EOL><DEDENT>else:<EOL><INDENT>text += sep;<EOL><DEDENT><DEDENT>if start == <NUM_LIT:0>:<EOL><INDENT>result.append(('<STR_LIT>'+str(length*(<NUM_LIT:2>+<NUM_LIT:1>)+<NUM_LIT:1>)+'<STR_LIT>') % (i, hexa, text));<EOL><DEDENT>else:<EOL><INDENT>result.append(('<STR_LIT>'+str(length*(<NUM_LIT:2>+<NUM_LIT:1>)+<NUM_LIT:1>)+'<STR_LIT>') % (start+i, i, hexa, text));<EOL><DEDENT><DEDENT>return '<STR_LIT:\n>'.join(result)<EOL>
@brief Return {src} in hex dump.
@param[in] length	{Int} Nb Bytes by row.
@param[in] sep		{Char} For the text part, {sep} will be used for non ASCII char.
@return {Str} The hexdump

@note Full support for python2 and python3 !