Parse and compose Magnet URI extension (BEP53) ranges

bep53-range

Parse and compose Magnet URI extension (BEP53) ranges.

Dart port of https://github.com/webtorrent/bep53-range

Usage

parse

Parse Magnet URI extension (BEP53) range and return all included values.

import 'package:bep53/bep53.dart';

final range = ['1-3', '6', '11-13']

const values = Bep53.parse(range)
print(values) // [1, 2, 3, 6, 11, 12, 13]

compose

Compose Magnet URI extension (BEP53) range from all included values.

import 'package:bep53/bep53.dart';

const values = [1, 2, 3, 6, 11, 12, 13]

const range = Bep53.compose(values)
print(range) // ['1-3', '6', '11-13']

GitHub

View Github