Home

Awesome

crystal-binary_parser

CircleCI GitHub release

Description

A binary parser for crystal.

Requirement

Install

Add this to your shard.yml

dependencies:
  binary_parser:
    github: DanSnow/crystal-binary_parser

Feature

Usage

require "binary_parser"

class Parser < BinaryParser
  uint8 :foo
end

# Load a file
parser = Parser.new
parser.load("<filename>")

# Or from IO
io = File.open("<filename>")
parser = Parser.new
parser.load(io)

# Now you can get your data
puts parser.foo

License

MIT