def encode_number_as_hex(num):
 num = bytes(hex(num)[2:].upper())
 nlen = len(num)
 if ((nlen % 2) != 0):
  num = ('0' + num)
 return encode_string(num)

def encode_number_as_hex ( num ) : num = bytes ( hex ( num ) [ 2 : ] . upper ( ) ) nlen = len ( num ) if ( ( nlen % 2 ) != 0 ) : num = ( '0' + num ) return encode_string ( num )
encode num as a variable length encoded hexadecimal number .