feat: add I2P BitTorrent engine, DHT, and Firefox torrent extension
- Add pure-MoonBit bittorrent package: bencode codec, metainfo/magnet parsing with path traversal checks, peer wire protocol (BEP 10/9), and I2P Kademlia DHT with KRPC and 54-byte compact nodes - Add SHA-1 primitive in crypto for torrent info hashes - Add router torrent API and engine, enabled with --torrent-api (default 127.0.0.1:4445) and --download-dir - Add Firefox WebExtension torrent manager with native messaging host and packed .xpi - Add scripts to build a standalone Firefox + router AppImage and install the native host - Add just targets (proxy, appimage, extension), README docs, and ignore .cache/ and dist/
This commit is contained in:
1 parent
14eae00f5c
commit
fbe6818c4e
37 files changed
+8543
-9
No files matched your search
@@ -286,3 +286,21 @@ test "curve25519 elligator2 encode/decode reference vectors and properties" {
|
||||
}
|
||||
assert_true(encodable_count >= 10)
|
||||
}
|
||||
|
||||
///|
|
||||
test "sha1 FIPS 180-4 / RFC 3174 test vectors" {
|
||||
assert_eq(
|
||||
@encoding.hex_encode(@crypto.sha1(b"")),
|
||||
"da39a3ee5e6b4b0d3255bfef95601890afd80709",
|
||||
)
|
||||
assert_eq(
|
||||
@encoding.hex_encode(@crypto.sha1(b"abc")),
|
||||
"a9993e364706816aba3e25717850c26c9cd0d89d",
|
||||
)
|
||||
assert_eq(
|
||||
@encoding.hex_encode(
|
||||
@crypto.sha1(b"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"),
|
||||
),
|
||||
"84983e441c3bd26ebaae4aa1f95129e5e54670f1",
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user