Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/brendanashworth/byter

Count same-byte occurrences within binary files
https://github.com/brendanashworth/byter

Last synced: 9 days ago
JSON representation

Count same-byte occurrences within binary files

Awesome Lists containing this project

README

        

# byter
[![GoDoc](https://godoc.org/github.com/brendanashworth/byter?status.svg)](http://godoc.org/github.com/brendanashworth/byter/api)

> A simple CLI utility (with an internal API) for calculating the percentages of same-byte occurrences within a binary file. By default it will print all bytes with an occurrence rate of more than 1%.

### Usage
```bash
$ go build
$ ./byter
```

Example output:
```
|--------------|
| 0x1 | 2% |
|--------------|
| 0x65 | 1% |
|--------------|
| 0x0 | 38% |
|--------------|
| 0x2 | 2% |
|--------------|
| 0x48 | 3% |
|--------------|
| 0x24 | 2% |
|--------------|
| 0x8B | 1% |
|--------------|

Parsed 2091696 bytes.
```

### Example API
```go
package main

import (
"github.com/brendanashworth/byter/api"
)

func main() {
var data []byte
// ..

totalBytes, occurrenceMap := byter.CountOccurrences(data)
// ..
}
```