function getTypeBits(type) {
    switch (type) {
      case 'pubkeyhash':
        return 0;
      case 'scripthash':
        return 8;
      default:
        throw new Error('Invalid type:'+ type);
    }
  }
Will return a cashaddr representation of the address. Always return lower case
Can be converted by the caller to uppercase is needed (still valid).

@returns {string} Bitcoin Cash address