package org.eclipse.paho.mqttv5.common;

/* JADX INFO: loaded from: classes2.dex */
public class Validators {
    protected static boolean isCharacterHighSurrogate(char c) {
        return c >= 55296 && c <= 56319;
    }

    public boolean validateClientId(String str) {
        int i = 0;
        int i2 = 0;
        while (i < str.length() - 1) {
            if (isCharacterHighSurrogate(str.charAt(i))) {
                i++;
            }
            i2++;
            i++;
        }
        return i2 < 65535;
    }
}
