• OCaml logo OCaml logo
  • Learn
  • Packages
  • Community
  • Blog
  • Playground
  • Searching...
    Or go to: Standard Library API
  • Learn
  • Packages
  • Community
  • Blog
  • Playground
  • Get started
  • sodium

  • Documentation
  • sodium lib
  • Sodium .Hash .Bytes Module
package sodium
  • sodium
    • Sodium
      • Auth
        • Bigbytes
        • Bytes
        • S
      • Box
        • Bigbytes
        • Bytes
        • S
      • Generichash
        • Bigbytes
        • Bytes
        • S
      • Hash
        • Bigbytes
        • Bytes
        • S
      • One_time_auth
        • Bigbytes
        • Bytes
        • S
      • Password_hash
        • Bigbytes
        • Bytes
        • S
      • Random
        • Bigbytes
        • Bytes
        • S
      • Scalar_mult
        • Bigbytes
        • Bytes
        • S
      • Secret_box
        • Bigbytes
        • Bytes
        • S
      • Sign
        • Bigbytes
        • Bytes
        • S
      • Stream
        • Bigbytes
        • Bytes
        • S
Legend:
Library
Module
Module type
Parameter
Class
Class type
type storage = Bytes.t
val of_hash : hash -> storage

of_hash h converts h to storage. The result is size bytes long.

val to_hash : storage -> hash

to_hash s converts s to a hash.

  • raises Size_mismatch

    if s is not size bytes long

val digest : storage -> hash

digest m computes a hash for message m.

Footer

OCaml

Innovation. Community. Security.

GitHub Discord Twitter Peertube RSS

About Us

  • Industrial Users
  • Academic Users
  • Why OCaml

Resources

  • Get Started
  • Language Manual
  • Standard Library API
  • Books
  • Releases

Community

  • Blog
  • Jobs

Policies

  • Carbon Footprint
  • Governance
  • Privacy
  • Code of Conduct