All Projects → DanSnow → crystal-binary_parser

DanSnow / crystal-binary_parser

Licence: MIT license
Binary parser for Crystal

Programming Languages

crystal
512 projects

Projects that are alternatives of or similar to crystal-binary parser

Asn1DerParser.NET
Abstract Syntax Notation One (ASN.1) binary parser to support Distinguished Encoding Rules (DER) in .NET
Stars: ✭ 31 (+72.22%)
Mutual labels:  binary-parser
d2s
Diablo II file format binary parser written in Go.
Stars: ✭ 126 (+600%)
Mutual labels:  binary-parser

crystal-binary_parser

CircleCI GitHub release

Description

A binary parser for crystal.

Requirement

  • crystal >= 0.20.0

Install

Add this to your shard.yml

dependencies:
  binary_parser:
    github: DanSnow/crystal-binary_parser

Feature

  • Parse and write binary file
  • Support array (fixed size or variable size)
  • Support string (fixed length or valirable length)
  • Support nested parser
  • Support config which endian to use
  • Calculate byte size

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].