lfe_bits(3)

πŸ“¦ version 2.2.0, in alpine 3.24, nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

Okay bestie, welcome to the lfe_bits(3) page β€” this is all about lfe_bits, aka the Lisp Flavoured Erlang (LFE) common binary functions. It’s giving β€œtiny utility closet for binaries” energy, and honestly? Iconic. ✨


πŸŽ€ SYNOPSIS πŸŽ€

This module contains a collection of library functions for handling binaries. They are generally not called by the user β€” like, this is not your main-character API, bestie, it’s backend utility stuff. πŸ’…


🌸 EXPORTS 🌸

parse_bitspecs(Specs) β€” the parser that spills the tea β˜•

parse_bitspecs(Specs) ->

                {ok,Size,{Type,Unit,Sign,Endian}} |
                {error,Error}.

This one parses a bitspec and returns the data. Unmentioned fields get the value default. So if a field isn’t mentioned, it’s lowkey just default. That’s the whole vibe. 🫢

get_bitspecs(Specs) β€” same energy, but with defaults applied πŸ’…

get_bitspecs(Specs) ->

                {ok,Size,{Type,Unit,Sign,Endian}} |
                {error,Error}.

Parse a bitspec, apply defaults, and return the data. Unmentioned fields get the value default. Yes bestie, it’s parse plus default-glow-up. ✨


πŸ’€ ERROR INFORMATION πŸ’€

The following error values are returned:

  • {undefined_bittype,Type}
  • bittype_unit

Those are the error values on the list β€” no more, no less. If you see one, that’s the vibe. 😭


🌈 AUTHORS 🌈

Robert Virding. That’s the author, periodt. πŸ‘‘


That’s it, bestie! Source/version: lfe_bits(3), date: 2011-2016. Bye 😘✨

πŸ“¦ where this page comes from