package data-encoding

  1. Overview
  2. Docs

Module Encoding.FixedSource

Create encodings that produce data of a fixed length when binary encoded. See the preamble for an explanation.

Sourceval string : int -> string encoding
Sourceval bytes : int -> Bytes.t encoding
Sourceval add_padding : 'a encoding -> int -> 'a encoding

add_padding e n is a padded version of the encoding e. In Binary, there are n null bytes (\000) added after the value encoded by e. In JSON, padding is ignored.