jhn_stdlib [(γ)][5] [![Build Status](](

A few thought experiments solidified as code.

  * [Introduction](#introduction)
  * [Features/Modules](#features)
  * [Build](#build)
  * [Install](#install)
  * [Contribute](#contribute) - Read if you're planning to submit patches

<a name='introduction'>


This library consists mainly of code that arose out of my curiosity, either
about Erlang and coding in general or concerning a pericular 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.

<a name='features'>


  * String Processing Functions for binary encoded strings
    * blist -- drop in replacement for the lists module in stdlib
    * bstring -- drop in replacement for the string module in stdlib
    * mustache -- Mustache template rendering
  * Protocols
    * Encoding/decoding JSON/Erlang  -- json [rfc4627][6], [rfc7159][7]
    * Encoding/decoding stream JSON/Erlang  -- jstream [rfc7159][7]
    * Encoding/decoding/evaluation JSON Pointer/Erlang  -- json [rfc6901][8]
    * Validation JSON schema -- json [draft-zyp-json-schema-04][10],
    * MessagePack -- msgpack [MessagePack][12]/Erlang
    * Bencoding -- bencoding
    * Encoding/decoding Syslog/Erlang -- syslog [rfc5424][13], [rfc5427][14]
  * Standards
    * Encoding/decoding URI/Erlang -- uri [rfc3986][15]
    * Encoding/decoding IP addresses/Erlang -- ip_addr [rfc4291][16],
    * Generating/encoding/decoding Timestamps Posix/Erlang -- timestamp
  * Clients
    * A simple HTTP client -- shttpc [rfc7230][20], [rfc7231][21],
                                     [rfc7538][22], [rfc5789][23],
    * Server/client for Syslog -- syslog [rfc5425][25], [rfc5426][26],
  * Pull oriented data source abstraction
    * lazy -- abstracts different data sources as uniform lazy data
  * Data structures
    * Bloom filters -- bloom
    * Property lists -- plist
    * Prefix trees -- p_tree
    * Binary(UTF-8) Prefix trees -- pb_tree
    * Range trees -- r_tree
    * T-trees -- t_tree
  * Algorithms
    * Levenshtein distance -- levenshtein

<a name='build'>


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


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

make test

Two things might seem alarming when running the tests:

  1. Warnings emitted by cover
  2. En exception printed by SASL

Both are expected due to the way Erlang currently prints errors. The
important line you should look for is `All XX tests passed`, if that
appears all is correct.

<a name='install'>


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.

<a name='contribute'>


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

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

       "Rebar - A build tool for Erlang"
       "jhn_stdlib issues"
       "Erlang/OTP commit messages"
       "Software release life cycle"
       "The application/json Media Type for JavaScript Object Notation (JSON)"
       "The JavaScript Object Notation (JSON) Data Interchange Format"
       "JavaScript Object Notation (JSON) Pointer"
       "JSON Schema: core definitions and terminology"
       "JSON Schema: interactive and non interactive validation"
       "An efficient binary serialization format"
       "The Syslog Protocol"
       "Textual Conventions for Syslog Management"
       "Uniform Resource Identifier (URI): Generic Syntax"
       "IP Version 6 Addressing Architecture"
       "A Recommendation for IPv6 Address Text Representation"
       "Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan"
       "Date and Time on the Internet: Timestamps"
       "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing"
       "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content"
       "The Hypertext Transfer Protocol Status Code 308 (Permanent Redirect)"
       "PATCH Method for HTTP"
       "HTTP Over TLS (rfc2818)"
       "Transport Layer Security (TLS) Transport Mapping for Syslog"
       "Transmission of Syslog Messages over UDP"
       "Transmission of Syslog Messages over TCP"