What is the meaining of ord(input) in RLP code example?
Bowfish opened this issue · 0 comments
Bowfish commented
In the RLP encoding section there is this pseudo code. What does ord(input) < 0x80
in the third line mean? What would be the c or c++ equivalent for this?
def rlp_encode(input):
if isinstance(input,str):
if len(input) == 1 and ord(input) < 0x80: return input
else: return encode_length(len(input), 0x80) + input
elif isinstance(input,list):
output = ''
for item in input: output += rlp_encode(item)
return encode_length(len(output), 0xc0) + output