Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.07 KB

README.md

File metadata and controls

39 lines (28 loc) · 1.07 KB

bep53-range is a library for parsing bep53 ranges.

Go Reference x codecov Go Report Card


Installation

go get github.com/go-bittorrent/bep53-range

Example

package main

import (
	"fmt"

	"github.com/go-bittorrent/bep53-range/bep53"
)

func main() {
	parsed, err := bep53.Parse([]string{"1-5", "2", "6-12"})
	if err != nil {
		panic(err)
	}

	fmt.Println(parsed)                // [1 2 3 4 5 2 6 7 8 9 10 11 12]
	fmt.Println(bep53.Compose(parsed)) // [1-5 2 6-12]
}

License

MIT