code: function(hostname) {
      const buf = pslBuffer8;
      if ( hostname === hostnameArg ) { return buf[LABEL_INDICES_SLOT]; }
      if ( hostname === null || hostname.length === 0 ) {
          hostnameArg = '';
          return (buf[LABEL_INDICES_SLOT] = 0);
      }
      hostname = hostname.toLowerCase();
      hostnameArg = hostname;
      let n = hostname.length;
      if ( n > 255 ) { n = 255; }
      buf[LABEL_INDICES_SLOT] = n;
      let i = n;
      let j = LABEL_INDICES_SLOT + 1;
      while ( i-- ) {
          const c = hostname.charCodeAt(i);
          if ( c === 0x2E /* '.' */ ) {
              buf[j+0] = i + 1;
              buf[j+1] = i;
              j += 2;
          }
          buf[i] = c;
      }
      buf[j] = 0;
      return n;
  }
docs: ***************************************************************************