Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Kata with some short/simple tasks on working with binarys in elixir.

Notifications You must be signed in to change notification settings

elixir-berlin/kata-binary

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BinaryKata

Kata for the Hamburg-Elixir Usergroup by Julius Beckmann (@h4cc).

Contents

This kata contains tasks for a few simple binary pattern matching functions like:

  • Has a content a UTF-8 BOM?
  • Remove a UTF-8 BOM from content.
  • Add a UTF-8 BOM to content.
  • Detect JPG/PNG/GIF images.
  • Read width and height from a GIF image.
  • Parsing a ARP packet.

Have fun!

Hints

  • Have a look out for binary values and magic constants.
  • Also check for endianess which can be little or big.
  • Make sure you use byte and bits correctly.
  • Use IO.inspect to "see" the stuff you are working with.
  • Use the iex -S mix shell to try stuff out.

Get yourself a HEX Editor to "see" the binary stuff in a file.

Resources

Elixir getting started with binaries: http://elixir-lang.org/getting-started/binaries-strings-and-char-lists.html

Resource for learning binary pattern matching: http://www.zohaib.me/binary-pattern-matching-in-elixir/

About

Kata with some short/simple tasks on working with binarys in elixir.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.