Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/DanSnow/crystal-binary_parser
Binary parser for Crystal
https://github.com/DanSnow/crystal-binary_parser
binary-parser crystal crystal-binary-parser
Last synced: about 1 month ago
JSON representation
Binary parser for Crystal
- Host: GitHub
- URL: https://github.com/DanSnow/crystal-binary_parser
- Owner: DanSnow
- License: mit
- Created: 2016-12-10T14:50:30.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-03-13T01:17:30.000Z (almost 3 years ago)
- Last Synced: 2024-10-27T17:28:28.930Z (about 2 months ago)
- Topics: binary-parser, crystal, crystal-binary-parser
- Language: Crystal
- Size: 64.5 KB
- Stars: 18
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
- awesome-crystal - crystal-binary_parser - Binary parser (Misc)
- awesome-crystal - crystal-binary_parser - Binary parser (Misc)
- awesome-crystal - crystal-binary_parser - Binary parser (Misc)
README
crystal-binary_parser
=====================[![CircleCI](https://circleci.com/gh/DanSnow/crystal-binary_parser.svg?style=shield)](https://circleci.com/gh/DanSnow/crystal-binary_parser)
[![GitHub release](https://img.shields.io/github/release/DanSnow/crystal-binary_parser.svg?style=flat-square)](https://github.com/DanSnow/crystal-binary_parser/releases)Description
-----------A binary parser for crystal.
Requirement
------------ crystal >= 0.20.0
Install
-------Add this to your `shard.yml`
```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 sizeUsage
-----```crystal
require "binary_parser"class Parser < BinaryParser
uint8 :foo
end# Load a file
parser = Parser.new
parser.load("")# Or from IO
io = File.open("")
parser = Parser.new
parser.load(io)# Now you can get your data
puts parser.foo
```License
-------MIT