chore: restart the repository with a clean history
CI / Docker image (push) Successful in 12s
CI / Server (push) Successful in 25s
CI / CLI (push) Successful in 13s
Development image / Development image (push) Successful in 21s
CI / CLI (windows) (push) Successful in 57s
CI / CLI (linux-arm64, static) (push) Successful in 1m37s
Release / Prepare release (push) Successful in 2s
Release / Server (linux-x64) (push) Successful in 53s
Release / CLI (linux-arm64, static) (push) Successful in 1m32s
Release / Docker image (push) Successful in 2m48s
Release / Server (windows-x64) (push) Successful in 6m20s
Release / CLI (windows-x64) (push) Successful in 6m48s
Release / CLI (linux-x64) (push) Successful in 7m8s
Release / Publish release (push) Successful in 1s

Squash the tree into one commit, drop docs/architecture.html, reset the version line to 0.3.0, consolidate the changelog, enable Renovate automerge for non-major updates and add AGENTS.md.
This commit is contained in:
fristy committed 2026-11-10 11:31:13 +03:00
commit 650807c1fb
438 files changed
+45070

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
const SIGNATURE = Buffer.from([0x0d, 0x0a, 0x0d, 0x0a, 0x00, 0x0d, 0x0a, 0x51, 0x55, 0x49, 0x54, 0x0a]);
const isPrefix = buffer => buffer.length < SIGNATURE.length
? SIGNATURE.subarray(0, buffer.length).equals(buffer)
: buffer.subarray(0, SIGNATURE.length).equals(SIGNATURE);
const ipv6 = buffer => {
const parts = [];
for (let i = 0; i < 8; i++) parts.push(buffer.readUInt16BE(i * 2).toString(16));
return parts.join(":");
};
const parse = buffer => {
if (buffer.length < 16) return null;
if ((buffer[12] >> 4) !== 2) return null;
const length = buffer.readUInt16BE(14);
if (buffer.length < 16 + length) return null;
const command = buffer[12] & 0x0f;
const family = buffer[13] >> 4;
const total = 16 + length;
if (command !== 1) return { ip: null, length: total };
if (family === 1) return { ip: `${buffer[16]}.${buffer[17]}.${buffer[18]}.${buffer[19]}`, length: total };
if (family === 2) return { ip: ipv6(buffer.subarray(16, 32)), length: total };
return { ip: null, length: total };
};
module.exports = { SIGNATURE, isPrefix, parse };