package crypt

  1. Overview
  2. Docs
A tiny binding for the Unix crypt function

Install

dune-project
 Dependency

Authors

Maintainers

Sources

2.0.tar.gz
md5=d53c940c6de1de77ad1e4f374679c8ad
sha512=713872cba6cf140594705b9f13291a2fb355ddb7eba42ea2a171828e08382efede7d6b1dff6d97c7cc1c32f9da50e9dbefde944fbbdff2107eed5e28b901b7f4

doc/README.html

crypt

A tiny binding for the Unix crypt function provides a high-level interface.

Installation

You can install the latest released version of the library using the OPAM package manager.

$ opam install crypt

Alternatively, you can pin the development (upstream) version.

$ opam pin crypt.dev https://github.com/vbmithr/ocaml-crypt.git

Quick Start

The Crypt module contains only one function, crypt, with several parameters.

# #require "crypt";;

# Crypt.crypt ~salt:"GUBv0xjJ" "hello";;
- : string = "GUpsIDCLVu8AY"

# Crypt.crypt ~derivation:Md5 ~salt:"GUBv0xjJ" "hello";;
- : string = "$1$GUBv0xjJ$rQSvX8r6cT7H/NItzzVNQ/"

If you don't provide any salt, a new salt will be generated every time the function is called.

# Crypt.crypt "hello";;
- : string = "QwD.wi5nLT/0s"

# Crypt.crypt "hello";;
- : string = "MYM.5hv5Lk2Mg"

For a deterministic generation, you should use one salt that you can generate using the Crypt.Salt module or another external module.

# let salt = Crypt.Salt.gen_base64 9;;
val salt : string = "dHiPl3q99"

# Crypt.crypt ~salt "hello";;
- : string = "dHDdeFGUWcGyQ"

References

License

The project is licensed under the ISC License, which allows for all permissions. Just use it and enjoy yourself without fear.