code: function createCurlsSubdomain(url) {
    // Get our domain from the passed url string
    const domain = (new Url(url)).hostname;
    if (isEligibleForHumanReadableCacheEncoding_(domain)) {
      const curlsEncoding = constructHumanReadableCurlsCacheDomain_(domain);
      if (curlsEncoding.length > MAX_DOMAIN_LABEL_LENGTH_) {
        return constructFallbackCurlsCacheDomain_(domain);
      } else {
        return Promise.resolve(curlsEncoding);
      }
    } else {
      return constructFallbackCurlsCacheDomain_(domain);
    }
  }
docs: Constructs a curls domain following these instructions:
  1. Convert pub.com from IDN (punycode) to utf-8, if applicable.
  2. Replace every “-” with “--”.
  3. Replace each “.” with “-”.
  4. Convert back to IDN.
  
  Examples:
  'https://something.com/'    =>  'something-com'
  'https://SOMETHING.COM/'    =>  'something-com'
  'https://hello-world.com'  =>  'hello--world-com'
  'https://hello--world.com' =>  'hello----world-com'
  
  Fallback applies to the following cases:
  - RFCs don’t permit a domain label to exceed 63 characters.
  - RFCs don’t permit any domain label to contain a mix of right-to-left and
  left-to-right characters.
  - If the origin domain contains no “.” character.
  
  Fallback Algorithm:
  1. Take the SHA256 of the punycode view of the domain.
  2. Base32 encode the resulting hash. Set the domain prefix to the resulting
  string.
  
  Also, this will only use the domain (hostname) from the passed URL to give output
  
  @param {string} url The complete publisher url.
  @return {!Promise<string>} The curls encoded domain.
  @private