code: def encode(data):
      '''
      bytes -> str
      '''
      if riemann.network.CASHADDR_PREFIX is None:
          raise ValueError('Network {} does not support cashaddresses.'
                           .format(riemann.get_current_network_name()))
  
      data = convertbits(data, 8, 5)
      checksum = calculate_checksum(riemann.network.CASHADDR_PREFIX, data)
  
      payload = b32encode(data + checksum)
  
      form = '{prefix}:{payload}'
      return form.format(
          prefix=riemann.network.CASHADDR_PREFIX,
          payload=payloadf encode(data):
      '''
      bytes -> str
      '''
      if riemann.network.CASHADDR_PREFIX is None:
          raise ValueError('Network {} does not support cashaddresses.'
                           .format(riemann.get_current_network_name()))
  
      data = convertbits(data, 8, 5)
      checksum = calculate_checksum(riemann.network.CASHADDR_PREFIX, data)
  
      payload = b32encode(data + checksum)
  
      form = '{prefix}:{payload}'
      return form.format(
          prefix=riemann.network.CASHADDR_PREFIX,
          payload=payload)
docs: bytes -> str