dartorrent_common 1.0.3 copy "dartorrent_common: ^1.0.3" to clipboard
dartorrent_common: ^1.0.3 copied to clipboard

A common library for Dart torrent client development. Include some common methods and class.

example/dartorrent_common_example.dart

import 'dart:io';
import 'dart:typed_data';

import 'package:dartorrent_common/dartorrent_common.dart';

void main() {
  var c = CompactAddress(
      InternetAddress.fromRawAddress(Uint8List.fromList(randomBytes(4))),
      12112);
  print(c);

  var c1 = CompactAddress.parseIPv4Address(c.toBytes());
  print(c1);

  var c2 = c1.clone();
  print(c2 == c);
  var bytes = CompactAddress.multipleAddressBytes([c, c1, c2]);
  print(bytes);
  var l = CompactAddress.parseIPv4Addresses(bytes);
  print(l);
  l.clear();

  /// find public trackers:
  findPublicTrackers().listen((urls) {
    print(urls);
  });
}
0
likes
30
pub points
26%
popularity

Publisher

unverified uploader

A common library for Dart torrent client development. Include some common methods and class.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

More

Packages that depend on dartorrent_common