code: public static boolean isAscii(Slice utf8)
      {
          int length = utf8.length();
          int offset = 0;
  
          // Length rounded to 8 bytes
          int length8 = length & 0x7FFF_FFF8;
          for (; offset < length8; offset += 8) {
              if ((utf8.getLongUnchecked(offset) & TOP_MASK64) != 0) {
                  return false;
              }
          }
          // Enough bytes left for 32 bits?
          if (offset + 4 < length) {
              if ((utf8.getIntUnchecked(offset) & TOP_MASK32) != 0) {
                  return false;
              }
  
              offset += 4;
          }
          // Do the rest one by one
          for (; offset < length; offset++) {
              if ((utf8.getByteUnchecked(offset) & 0x80) != 0) {
                  return false;
              }
          }
  
          return true;
      }
docs: Does the slice contain only 7-bit ASCII characters.