package snappy

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Snappy compression/uncompression

exception Error of string

This exception is raised on malformed input

Easy interface

val compress : string -> string
  • returns

    compressed string

val is_valid : string -> bool
  • returns

    whether input string can be successfully uncompressed

val get_uncompressed_size : string -> int
  • returns

    number of bytes needed to store the result of uncompressing given input

val uncompress : string -> string
  • returns

    uncompressed string

Substring interface

function_sub input offset length is equivalent to function but operates on the substring of the given input string, defined by offset and length, raising Invalid_argument when offset and length do not represent a valid substring of input

val compress_sub : string -> int -> int -> string
val is_valid_sub : string -> int -> int -> bool
val get_uncompressed_size_sub : string -> int -> int -> int
val uncompress_sub : string -> int -> int -> string

Unsafe interface

Substring interface without bounds checking

val unsafe_compress : string -> int -> int -> string
val unsafe_is_valid : string -> int -> int -> bool
val unsafe_get_uncompressed_size : string -> int -> int -> int
val unsafe_uncompress : string -> int -> int -> string
OCaml

Innovation. Community. Security.