![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/lavocat.quebec/private_html/node_modules/b4a/lib/ |
function byteLength(string) {
return string.length >>> 1
}
function toString(buffer) {
const len = buffer.byteLength
buffer = new DataView(buffer.buffer, buffer.byteOffset, len)
let result = ''
let i = 0
for (let n = len - (len % 4); i < n; i += 4) {
result += buffer.getUint32(i).toString(16).padStart(8, '0')
}
for (; i < len; i++) {
result += buffer.getUint8(i).toString(16).padStart(2, '0')
}
return result
}
function write(buffer, string) {
const len = buffer.byteLength
for (let i = 0; i < len; i++) {
const a = hexValue(string.charCodeAt(i * 2))
const b = hexValue(string.charCodeAt(i * 2 + 1))
if (a === undefined || b === undefined) {
return buffer.subarray(0, i)
}
buffer[i] = (a << 4) | b
}
return len
}
module.exports = {
byteLength,
toString,
write
}
function hexValue(char) {
if (char >= 0x30 && char <= 0x39) return char - 0x30
if (char >= 0x41 && char <= 0x46) return char - 0x41 + 10
if (char >= 0x61 && char <= 0x66) return char - 0x61 + 10
}