brendanashworth / byter

Count same-byte occurrences within binary files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

byter

GoDoc

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

$ go build
$ ./byter <file>

Example output:

|--------------|
| 0x1  | 2%    |
|--------------|
| 0x65 | 1%    |
|--------------|
| 0x0  | 38%   |
|--------------|
| 0x2  | 2%    |
|--------------|
| 0x48 | 3%    |
|--------------|
| 0x24 | 2%    |
|--------------|
| 0x8B | 1%    |
|--------------|

Parsed 2091696 bytes.

Example API

package main

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

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

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

About

Count same-byte occurrences within binary files

License:MIT License


Languages

Language:Go 100.0%