Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
convto authored May 30, 2022
1 parent 643faee commit b5c278a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# bit
[![Go Reference](https://pkg.go.dev/badge/github.com/convto/bit.svg)](https://pkg.go.dev/github.com/convto/bit) [![Go Report Card](https://goreportcard.com/badge/github.com/convto/bit)](https://goreportcard.com/report/github.com/convto/bit) [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

This package provides Encode/Decode functionality for byte sequences to bit strings.
For example, a byte represented by the hexadecimal number `ff` would be encoded as `1111111111` .
This package provides encoding for converting byte sequences to bit strings.
For example, a byte represented by the hexadecimal number `ff` would be encoded as `11111111` .

Inspired by the standard package encoding/hex. I also got some implementation hints from it.

Expand All @@ -16,15 +16,15 @@ for i := 0; i < len(src); i++ {
```

In some cases, this is sufficient. However, this does not implement `io.Reader` or `io.Writer` , so flexible handling such as stream support is not possible.
In addition, it is tedious to output in a human-readable format such as `xxd -b`.
In addition, it is tedious to output in a human-readable format like `xxd -b`.

Therefore, outputting bit strings using the standard package `fmt` is inconvenient, for example, when debugging a program that evaluates binaries.

I created this package for more flexible handling (e.g. `io.Reader` and `io.Writer` support, Or `Dump()` output support like `xxd -b` ).

## Usage

Here are the basics. If you want more details, please refer to example_test or the package documentation.
Here are the basics. If you want more details, please refer to [example_test](./bit_example_test.go) or [package documentation](https://pkg.go.dev/github.com/convto/bit).

### Encode

Expand Down Expand Up @@ -76,4 +76,4 @@ fmt.Printf("%s\n", dump)
```

## LICENSE
MIT
MIT

0 comments on commit b5c278a

Please sign in to comment.