Search documentation of jhn_stdlib

# jhn_stdlib (γ)

View Source

A few thought experiments solidified as code: CBOR, HPACK, JSON, MessagePack, syslog, URI, IP addresses, Timestamp, UUID, TypeID, mocking, cacerts, media type determination

- Introduction
- Behaviours
- Features/Modules
- Deprecated Features/Modules
- Build
- Install
- Contribute - Read if you're planning to submit patches

## Introduction

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

## Features/Modules

- 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
  - HPACK -- encoding/decoding -- `jhn_hpack` rfc7541
  - 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` rfc9562, rfc8141
- Clients
  - HTTP -- client -- `jhn_shttpc` rfc7230, rfc7231, rfc7538, rfc5789, rfc2818
  - Syslog -- server/client -- `jhn_syslog` rfc5425, rfc5426, rfc6587
- Pull oriented data source abstraction
  - lazy -- `jhn_lazy` abstracts different data sources as uniform lazy data
- Data structures
  - Bloom filters -- `jhn_bloom` Bloom Filters
  - Property lists -- `jhn_plist`
  - Prefix trees -- `jhn_p_tree` Prefix Tree
  - Binary(UTF-8) Prefix trees -- `jhn_pb_tree` Prefix Tree, UTF-8
  - Range trees -- `jhn_r_tree` Range Tree
  - T-trees -- `jhn_t_tree` T-tree
- 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
- Utility
  - Mocking -- `jhn_shadow`
  - CA-Certs -- `jhn_cacerts`
  - Media type determination -- `jhn_magic` media-types

## Deprecated Features/Modules

## Build

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

## 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.

## Contribute

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

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.

Next Page → LICENSE