https://github.com/newtoallofthis123/huffman
Huffman Encoding Library Implemented in Go
https://github.com/newtoallofthis123/huffman
go-library golang huffman-coding huffman-compression-algorithm huffman-go
Last synced: 2 months ago
JSON representation
Huffman Encoding Library Implemented in Go
- Host: GitHub
- URL: https://github.com/newtoallofthis123/huffman
- Owner: newtoallofthis123
- License: mit
- Created: 2024-07-29T06:52:03.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-08-30T20:38:18.000Z (8 months ago)
- Last Synced: 2025-01-16T04:12:57.042Z (4 months ago)
- Topics: go-library, golang, huffman-coding, huffman-compression-algorithm, huffman-go
- Language: Go
- Homepage: https://pkg.go.dev/github.com/newtoallofthis123/huffman
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Huffman
Huffman encoding library implemented in Go
This does not include any type of Reader or Writer although it is planned.## Installation
This is a native implementation of the Huffman encoding algorithm in Go. To install it, you can use the `go get` command:
```bash
go get github.com/newtoallofthis123/huffman
```## Example
```go
package mainfunc main(){
chars := []rune{'A', 'A', 'A', 'B', 'B', 'B', 'B', 'B', 'C', 'C', 'C', 'C', 'C', 'C', 'D', 'D', 'D', 'D', 'E', 'E'}
// This is needed since the library is implemented on generic slices
interfaces := huffman.ConvertToInterface(chars)h := huffman.FromList(interfaces)
res := h.Encode()
r := h.Decode(res)fmt.Println(r, res)
}
```## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details