Warning: session_start(): open(/var/lib/php/sessions/sess_0sa7kt937oncpmddr3b3a8sbh2, 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
scope byteArrayToBase128Utf8
static int #byteFromArray(byte[] data, int i) {
ret i >= data.length ? 0 : ubyteToInt(data[i]);
}
static byte[] byteArrayToBase128Utf8(byte[] data) {
int n = l(data);
int nOut = idiv_ceil(n, 7)*8;
byte[] out = new byte[nOut];
int iIn = 0, iOut = 0;
while (iOut < nOut) {
// take top 7 bits of byte 0
out[iOut] = (byte) (byteFromArray(data, iIn) >> (8-7));
if (++iOut >= n) break;
// take bottom bit of byte 0 + top 6 bits of byte 1
out[iOut] = (byte) (0x7F & (byteFromArray(data, iIn) << (7-1) | byteFromArray(data, iIn+1) >> (8-6));
if (++iOut >= n) break;
// take bottom 2 bits of byte 1 + top 5 bits of byte 2
out[iOut] = (byte) (0x7F & (byteFromArray(data, iIn+1) << (7-2) | byteFromArray(data, iIn+2) >> (8-5));
if (++iOut >= n) break;
// take bottom 3 bits of byte 2 + top 4 bits of byte 3
out[iOut] = (byte) (0x7F & (byteFromArray(data, iIn+2) << (7-3) | byteFromArray(data, iIn+3) >> (8-4));
if (++iOut >= n) break;
// take bottom 4 bits of byte 3 + top 3 bits of byte 4
out[iOut] = (byte) (0x7F & (byteFromArray(data, iIn+3) << (7-4) | byteFromArray(data, iIn+4) >> (8-3));
if (++iOut >= n) break;
// take bottom 5 bits of byte 4 + top 2 bits of byte 5
out[iOut] = (byte) (0x7F & (byteFromArray(data, iIn+4) << (7-5) | byteFromArray(data, iIn+5) >> (8-2));
if (++iOut >= n) break;
// take bottom 6 bits of byte 5 + top bit of byte 6
out[iOut] = (byte) (0x7F & (byteFromArray(data, iIn+5) << (7-6) | byteFromArray(data, iIn+6) >> (8-1));
if (++iOut >= n) break;
// take bottom 7 bits of byte 6
out[iOut] = (byte) (0x7F & byteFromArray(data, iIn+6));
if (++iOut >= n) break;
iIn += 7;
}
ret out;
}