All Projects → Cosmo → Binarykit

Cosmo / Binarykit

Licence: mit
💾🔍🧮 BinaryKit helps you to break down binary data into bits and bytes, easily access specific parts and write data to binary.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Binarykit

Bits
A bite sized library for dealing with bytes.
Stars: ✭ 16 (-82.61%)
Mutual labels:  binary, bytes, data
Js Crc32
🌀 JS standard CRC-32 implementation
Stars: ✭ 271 (+194.57%)
Mutual labels:  bytes, data
Jschema
A simple, easy to use data modeling framework for JavaScript
Stars: ✭ 261 (+183.7%)
Mutual labels:  hacktoberfest, data
Faker
Faker is a pure Elixir library for generating fake data.
Stars: ✭ 673 (+631.52%)
Mutual labels:  hacktoberfest, data
Parsr
Transforms PDF, Documents and Images into Enriched Structured Data
Stars: ✭ 2,736 (+2873.91%)
Mutual labels:  hacktoberfest, data
Simulink-Arduino-Serial
How to connect Arduino and Simulink
Stars: ✭ 54 (-41.3%)
Mutual labels:  binary, bytes
Pyjanitor
Clean APIs for data cleaning. Python implementation of R package Janitor
Stars: ✭ 647 (+603.26%)
Mutual labels:  hacktoberfest, data
Js Adler32
☑️ ADLER-32 checksum
Stars: ✭ 116 (+26.09%)
Mutual labels:  bytes, data
Brasil.io
Backend do Brasil.IO (para código dos scripts de coleta de dados, veja o link na página de cada dataset)
Stars: ✭ 780 (+747.83%)
Mutual labels:  hacktoberfest, data
Web
React web interface for the OpenDota platform
Stars: ✭ 889 (+866.3%)
Mutual labels:  hacktoberfest, data
Climate Change Data
🌍 A curated list of APIs, open data and ML/AI projects on climate change
Stars: ✭ 195 (+111.96%)
Mutual labels:  hacktoberfest, data
Geeksforgeeks Dsa 2
This repository contains all the assignments and practice questions solved during the Data Structures and Algorithms course in C++ taught by the Geeks For Geeks team.
Stars: ✭ 53 (-42.39%)
Mutual labels:  hacktoberfest, data
Free Ai Resources
🚀 FREE AI Resources - 🎓 Courses, 👷 Jobs, 📝 Blogs, 🔬 AI Research, and many more - for everyone!
Stars: ✭ 192 (+108.7%)
Mutual labels:  hacktoberfest, data
xbpch
xarray interface for bpch files
Stars: ✭ 17 (-81.52%)
Mutual labels:  data, binary
Bytearray.js
An equivalent to Actionscript 3's ByteArray for Javascript with AMF0 and AMF3 support.
Stars: ✭ 100 (+8.7%)
Mutual labels:  binary, bytes
Altair
✨⚡️ A beautiful feature-rich GraphQL Client for all platforms.
Stars: ✭ 3,827 (+4059.78%)
Mutual labels:  hacktoberfest, data
Rows
A common, beautiful interface to tabular data, no matter the format
Stars: ✭ 739 (+703.26%)
Mutual labels:  hacktoberfest, data
Dataframes.jl
In-memory tabular data in Julia
Stars: ✭ 951 (+933.7%)
Mutual labels:  hacktoberfest, data
Core
Open source Dota 2 data platform
Stars: ✭ 1,266 (+1276.09%)
Mutual labels:  hacktoberfest, data
Sentinel Cpp
C++ implementation of Sentinel
Stars: ✭ 91 (-1.09%)
Mutual labels:  hacktoberfest

BinaryKit

BinaryKit helps you to break down binary data into bits and bytes, easily access specific parts and write data to binary.

Access Bytes

By using any read* method (readByte(), readBytes(quantity:), readBit(), …), BinaryKit will increment an internal cursor (or reading offset) to the end of the requested bit or byte, so the next read* method can continue from there.

Any get* method (getByte(index:), getBytes(range:), getBit(index:), …) will give access to binary data at any given location — without incrementing the internal cursor.

Here are the methods you can call:

var binary = Binary(bytes: [0xDE, 0xAD, 0xBE, 0xEF, ])

// Reads exactly 1 byte and
// increments the cursor by 1 byte 
try binary.readByte()

// Reads the next 4 bytes and
// increments the cursor by 4 bytes
try binary.readBytes(4)

// Reads the next 1 bit and
// increments the cursor by 1 bit
try binary.readBit()

// Reads the next 4 bits and
// increments the cursor by 4 bits
try binary.readBits(4)

Example

var binary = Binary(bytes: [0b1_1_0_1_1_1_0_0])
//                            | | | | | | | | 
//                            | | | | | | | try binary.readBit()  // 0
//                            | | | | | | try binary.readBit()    // 0
//                            | | | | | try binary.readBit()      // 1
//                            | | | | try binary.readBit()        // 1
//                            | | | try binary.readBit()          // 1
//                            | | try binary.readBit()            // 0
//                            | try binary.readBit()              // 1
//                            try binary.readBit()                // 1

This shows how easy it is, to break down an IPv4 header.

var binary = Binary(bytes: [0x1B, 0x44, ])
let version                         = try binary.readBits(4)
let internetHeaderLength            = try binary.readBits(4)
let differentiatedServicesCodePoint = try binary.readBits(6)
let explicitCongestionNotification  = try binary.readBits(2)
let totalLength                     = try binary.readBytes(2)
let identification                  = try binary.readBytes(2)
let flags                           = try binary.readBits(4)
let fragmentOffset                  = try binary.readBits(12)
let timeToLive                      = try binary.readByte()
let protocolNumber                  = try binary.readByte()
let headerChecksum                  = try binary.readBytes(2)
let sourceIpAddress                 = try binary.readBytes(4)
let destinationIpAddress            = try binary.readBytes(4)
...

Store Bytes

Use the write* methods to store different types to binary.

var binary = Binary()
binary.writeInt32(1_350_849_546)
binary.writeString("Hello World!")
binary.writeBytes([0xFF, 0xCC, 0x00, 0x01])
binary.writeBool(true)

Contact

Other Projects

  • Clippy — Clippy from Microsoft Office is back and runs on macOS! Written in Swift.
  • GrammaticalNumber — Turns singular words to the plural and vice-versa in Swift.
  • HackMan — Stop writing boilerplate code yourself. Let hackman do it for you via the command line.
  • ISO8859 — Convert ISO8859 1-16 Encoded Text to String in Swift. Supports iOS, tvOS, watchOS and macOS.
  • SpriteMap — SpriteMap helps you to extract sprites out of a sprite map. Written in Swift.
  • StringCase — Converts String to lowerCamelCase, UpperCamelCase and snake_case. Tested and written in Swift.
  • TinyConsole — TinyConsole is a micro-console that can help you log and display information inside an iOS application, where having a connection to a development computer is not possible.

License

BinaryKit is released under the MIT License.

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].