Skip to content

sheganinans/Smoosh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smoosh: Every last bit out of your messaging protocol!

Smoosh Nuget

Smoosh.Latency Nuget

Bit oriented

If your type fits in a bit, it's encoded as a bit. Some types are even encoded as zero bits!

Blazing Fast

Basic Usage

open Smoosh.Latency.Decoder
open Smoosh.Latency.Encoder

type Tree =
  | Leaf
  | Node of byte * Tree * Tree

let rec mkTree d =
  if d = 0
  then Leaf
  else Node (0xF0uy, mkTree (d-1), mkTree (d-1))

let tree = mkTree 10

let treeEnc = mkEncoder<Tree> () 
let treeDec = mkDecoder<Tree> ()

let eTree = tree |> treeEnc

eTree |> BitConverter.ToString |> printfn "%s"
eTree |> treeDec |> fun dTree -> printfn $"%i{eTree.Length}: %b{dTree = tree}"

You should expect to see:

F8-7C-3E-1F-0F-87-C3-E1-...-F8-7C-3E-07-C0-F8-7C-0F-80
1279: true

Read more samples here!

Read the Specs!

General Encoder

Latency Sensitive Encoder

TODO

TODO.md

Special Thanks

This project was inspired by: Flat

About

A Blazing Fast, Bit-Oriented Serializer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages