Jan Henry Nystrom's standard library,CBOR, JSON, MessagePack, Syslog, URI, IP address, Timestamp, UUID, TypeID,prefix/range/T-trees, Bloom filters, HTTP client, Mustache rendering, and Server and FSM behaviours


License
Apache-2.0

Documentation

jhn_stdlib (γ)

A few thought experiments solidified as code: CBOR, JSON, MessagePack, syslog, URI, IP addresses, Timestamp, UUID, TypeID

This library consists mainly of code that arose out of my curiosity, either about Erlang and coding in general or concerning a perticular protocol or technique. So there is little of cohesion in purposes between the different library modules. But having published these I will continue to support these since the road to enlightenment is one without terminus.

Behaviours

  • jhn_server -- A generic server
  • jhn_fsm -- A FSM with the ability to defer acting on events until a later state
  • String Processing Functions for binary encoded strings
    • jhn_blist -- drop in replacement for the lists module in stdlib
    • jhn_bstring -- drop in replacement for the string module in stdlib
    • jhn_mustache -- Mustache (template system)
  • Protocols
    • Bencoding -- encoding/decoding -- jhn_bencoding
    • CBOR -- encoding/decoding -- jhn_cbor rfc8949, rfc9542
    • JSON -- encoding/decoding -- jhn_json rfc8259
    • JSON Pointer -- encoding/decoding/evaluation -- jhn_json rfc6901
    • JSON Patch -- evaluation -- jhn_json rfc6902
    • JSON Merge Patch -- evaluation -- jhn_json rfc7396
    • MessagePack -- encoding/decoding -- jhn_msgpack MessagePack/Erlang
    • Syslog -- encoding/decoding -- jhn_syslog rfc5424, rfc5427, rfc6012
  • Standards
    • IP Addresses -- encoding/decoding -- jhn_ip_addr rfc4291, rfc5952, rfc4632
    • Timestamps -- generating/encoding/decoding -- jhn_timestamp rfc3339, rfc7231
    • TypeID -- generating/encoding/decoding -- jhn_typeid TypeID
    • URI -- encoding/decoding -- jhn_uri rfc3986
    • UUID -- generating/encoding/decoding -- jhn_uuid rfc9562rfc8141
  • Clients
  • Pull oriented data source abstraction
    • lazy -- jhn_lazy abstracts different data sources as uniform lazy data
  • Data structures
  • Algorithms
    • Levenshtein distance -- jhn_math:levenshtein/2 Levenshtein
    • Check digit
      • Luhn algorithm -- jhn_math:levenshtein/2 Luhn
      • Verhoeff algorithm -- jhn_math:verhoeff/2 Verhoeff
      • Damm check algorithm -- jhn_math:damm/2 Damm
    • Checksums
      • CRC32-C checksum -- jhn_hash:crc32c/1 rfc9260
      • xxHash-32 checksum -- jhn_hash:xxh32/1, jhn_hash:xxh32/2 xxHash
    • Consistent Hashing -- jhn_chash:jump/2 J. Lamping, Eric Veach

jhn_stdlib requires rebar3 to build, but provides make support to download and install rebar. To build jhn_stdlib, go to the jhn_stdlib directory and type:

make

To make sure jhn_stdlib works on your platform, run the tests:

make test

If you want to install your own built version of jhn_stdlib add the ebin directory to your Erlang code path or move the jhn_stdlib folder into your release folder and make sure that folder is in your ERL_LIBS environment variable.

Should you find yourself using jhn_stdlib and have issues, comments or feedback please [create an issue here on GitHub.] 2

Patches are greatly appreciated, but since these libraries reflect my learning process and I have rather peculiar notions of code hygiene I may do extensive rewrites that does not in any way diminish the appreciation I feel or indeed express

For a much nicer history, please write good commit messages. I know I really should.