我想将字符串转换为 ASCII 代码,如下所述。我已经实现了编码和解码功能,但我不明白块大小是多少?我该如何实施?
编码和解码功能:
def encode(text, block_size):
PL = []
for char in text:
PL.append(ord(char))
return PL
def decode(PL, block_size):
text = ''.join(map(chr,PL))
return text