Warning: session_start(): open(/var/lib/php/sessions/sess_puovpvd8jj8pvelu67k1mfqasp, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
static int compareUtf8(byte[] left, byte[] right) {
int n = min(left.length, right.length);
for (int i = 0; i < n; i++) {
int a = left[i] & 0xff;
int b = right[i] & 0xff;
if (a != b) ret a-b;
}
ret left.length - right.length;
}
p {
bool ok = true;
repeat 10000 {
//S a = aGlobalID(), b = aGlobalID();
S a = totallyRandomChars(10), b = totallyRandomChars(10);
try {
assertEquals(sign(a.compareTo(b)), sign(compareUtf8(toUtf8(a), toUtf8(b))));
} catch print short e {
print(toHex(toUtf8(a)) + " " + toHex(toUtf8(b)));
ok = false;
}
}
if (ok) print("OK!");
}