code: def decode_int(v):
      
      if len(v) > 0 and (v[0] == b'\x00' or v[0] == 0):
          raise Exception("No leading zero bytes allowed for integers")
      return big_endian_to_int(v)
docs: decodes and integer from serialization