X-Git-Url: http://www.git.cypherpunks.ru/?p=pyderasn.git;a=blobdiff_plain;f=pyderasn.py;fp=pyderasn.py;h=0a6613767d33a846cd18defc5746c72ffa4b890c;hp=bb62acb437c203fa31ee66e03d6789e302a59fdd;hb=3efc66f10570dd96befbb3652ab78e827ec591b2;hpb=7d46c409b2bbdc2d0cfbce447e39a51af50932ee diff --git a/pyderasn.py b/pyderasn.py index bb62acb..0a66137 100755 --- a/pyderasn.py +++ b/pyderasn.py @@ -1159,8 +1159,6 @@ Now you can print only the specified tree, for example signature algorithm:: """ from array import array -from codecs import getdecoder -from codecs import getencoder from collections import namedtuple from collections import OrderedDict from copy import copy @@ -1441,20 +1439,16 @@ class BoundsError(ASN1Error): # Basic coders ######################################################################## -_hexdecoder = getdecoder("hex") -_hexencoder = getencoder("hex") - - def hexdec(data): """Binary data to hexadecimal string convert """ - return _hexdecoder(data)[0] + return bytes.fromhex(data) def hexenc(data): """Hexadecimal string to binary data convert """ - return _hexencoder(data)[0].decode("ascii") + return data.hex() def int_bytes_len(num, byte_len=8):