huffman
Version, currently master branch1 version
- master branchlatestJul 28, 2018
github.com/chenkovsky/huffman
huffman algorithm in crystal
2 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
huffman:
github: chenkovsky/huffman
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.25.1- License
- MIT
- Author
- chenkovsky
Dependencies
This version declares no dependencies.
README
huffman
Huffman Encoding
Installation
Add this to your application's shard.yml:
dependencies:
huffman:
github: chenkovsky/huffman
Usage
require "huffman"
it "works" do
symbols = ["F", "O", "R", "G", "E", "T"]
freqs = [2, 3, 4, 4, 5, 7]
huff = Huffman.compile(freqs)
huff.path_codes.map { |_, _, bs| bs.map { |b| b ? "1" : "0" }.join("") }.should eq(["000", "100", "111", "011", "10", "01"])
end
TODO: Write usage instructions here
Development
TODO: Write development instructions here
Contributing
- Fork it (https://github.com/chenkovsky/huffman/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- chenkovsky chenkovsky - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Jul 28, 2018
- Crystal
0.25.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/chenkovsky/huffman
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 16, 2026
- Synced
- Aug 16, 2026
- Versions
- 1