/specifications

Specifications for better computing

The Specifications Project

Specifications for better computing.

Released Specifications:

Late Development (unlikely to change much):

Early Development (likely to change):

  • Streamux: A minimalist, asynchronous, multiplexing, request-response protocol.

Compact Float Format

Compact float format is an encoding scheme to store a decimal floating point value in as few bytes as possible for data transmission.

Compact float can store all of the kinds of values that the IEEE754 decimal types can, without data loss:

  • ±0
  • ±infinity
  • Signaling and quiet NaNs

Specification

Implementation

Status: Released

Alternative To:

  • IEEE754 Floating point

Compact Time Format

An encoding scheme to store dates, times, and timestamps, down to the nanosecond, in as few bytes as possible.

Features

  • Encodes a date into as few as 3 bytes.
  • Encodes a time into as few as 4 bytes.
  • Encodes a timestamp into as few as 5 bytes.
  • Supports unlimited positive and negative year values.
  • Supports time units down to the nanosecond.
  • Supports leap years and leap seconds.
  • Maintenance-free (no leap second tables to update).
  • Efficient conversion to/from human readable fields (no multiplication or division).
  • Time zones are location-based.

Specification

Implementation

Status: Released

Alternative To:


Concise Binary and Text Encoding

CBE and CTE are general purpose, compact representations of semi-structured hierarchical data, in binary and text formats. They support all common data types, including dates, URIs, and decimal floating point values.

Concise Encoding is the next step in the evolution of ad-hoc hierarchical data formats, aiming to address the shortfalls of the current generation:

  • It is split into two formats: binary-based CBE and text-based CTE, which serve different but parallel purposes.
  • 1:1 type compatiblility between the binary and text formats. Converting between CBE and CTE is transparent, allowing you to use the much smaller and energy efficient binary format for data interchange and storage, converting to/from text only when and where a human needs to be involved.
  • Native support for the most commonly used data types. Concise Encoding aims to support 80% of data use cases natively.
  • Support for metadata and comments.
  • Completely redesigned from the ground up to balance user readability, encoded size, and codec complexity.
  • The formats are fully specified, eliminating ambiguities and covering edge cases, thus facilitating compatibility between implementations and reducing complexity.
  • Documents and specifications are versioned to support future expansion.

Specifications

Implementations

CBE:

CTE:

Status: Prerelease

Alternative To:

  • JSON
  • XML
  • BSON
  • CBOR
  • MessagePack
  • Protobuf

Safe Text Encoding

Binary data encoding schemes that are safe to be passed through modern processing systems that expect human readable text, without requiring escaping.

Features: All

  • Safe for use in JSON, SGML formats, source code strings, without escaping
  • Safe for use in path, query, and fragment components of URIs
  • Safe for use in formatted documents
  • Safe for use in legacy text processing systems
  • Support for length fields
  • Liberal whitespace rules
  • No padding characters
  • Safe for use in filenames on POSIX file systems
  • Sortable in generic text sorting algorithms (such as file listings)

Features: Safe80 and below

  • Safe for use in filenames on Windows file systems

Features: Safe64 and below

  • Safe for use in all URI components without escaping

Features: Safe32 and below

  • Useful for human input situations such as activation codes
  • Easily confusable characters & digits are interchangeable
  • Uppercase and lowercase characters are interchangeable

Specification

Implementation

Status: Released

Alternative To:

  • Base16
  • Base32
  • Base64
  • Ascii85

Smalltime

Smalltime offers a simple and convenient way to encode date & time values into signed 64-bit integers that are comparable.

Features

  • Encodes a complete date & time into a 64-bit signed integer.
  • Fields (including year) are compatible with ISO-8601.
  • Maintenance-free (no leap second tables to update).
  • Easily converts to human readable fields.
  • Supports hundreds of thousands of years.
  • Supports time units to the microsecond.
  • Supports leap years and leap seconds.
  • Values are in timezone zero by default.
  • Encoded values are comparable.

Specification

Implementation

Status: Released

Alternative To:


Streamux

A minimalist, asynchronous, multiplexing, request-response protocol.

A minimalist, asynchronous, multiplexing, request-response protocol.

Streamux is designed as a low level, point-to-point, bidirectional protocol for you to build a messaging layer on top of. It handles the nitty gritty things like initialization, multiplexing, asynchronous operation, and packetization of your messages.

The only additional components required are:

  • A reliable communication transport (TCP, pipes, RS-232, etc)
  • A message encoding format & marshaling scheme (for example CBE)
  • Endpoints to receive the messages.

Features

  • Minimal Overhead (1 to 4 bytes per message chunk, depending on configuration)
  • Multiplexing (multiple data streams can be sent across a single channel)
  • Asynchronous (client is informed asynchronously upon completion or error)
  • Interruptible (requests may be canceled)
  • Floating roles (both peers can operate as client and server at the same time)
  • Quick init mode for faster initialization

Specification

Implementation

Status: Prerelease


Variable Bit Padding

A scheme for encoding an arbitrary number of padding bits in a field or bit stream.

Features

  • Padding can be decoded from the left or right side.
  • Padding can be 0-based (filled with 0 bits) or 1-based (filled with 1 bits).

Specification

Implementation

  • TODO

Status: Released


Variable Length Quantity

Variable Length Quantity (VLQ) encoding is an unsigned integer compression scheme originally designed for the MIDI file format. This specification expands upon it slightly by allowing encoding from the "left" or "right" side of the quantity (the original MIDI version is "right" oriented).

Features

  • Left or right oriented encoding
  • Supports progressive decoding

Specification

Implementation

Status: Released

Alternative To:


Varpad

Varpad is a padding encoding scheme that allows unambiguous detection of the padding length without requiring an external field. It is similar to the scheme described in PKCS#7, but doesn't suffer from its limitations (PKCS#7 padding has a length limit of 255).

Features

  • Doesn't require a separate length field (the length is embedded in the padding itself).
  • Padding length can be unambiguously detected by examining the first or last byte.
  • No upper limit on padding length.

Specification

Implementation

Status: Released

Alternative To: