Crypto: add docstrings

This commit is contained in:
Marco Stronati 2019-02-13 15:22:27 +01:00 committed by Grégoire Henry
parent c7c8d64557
commit fd4f435e2e
No known key found for this signature in database
GPG Key ID: 827A020B224844F1
2 changed files with 5 additions and 0 deletions

View File

@ -89,6 +89,7 @@ val register_encoding:
wrap: ('a -> data) ->
'a encoding
(** Checks that an encoding has a certain prefix and length. *)
val check_encoded_prefix: 'a encoding -> string -> int -> unit
module Alphabet : sig

View File

@ -117,6 +117,10 @@ module Make_minimal (K : Name) = struct
Blake2b.final state
let path_length = 6
(** Converts [key] to hex thus doubling its size then splits it into a list of
length [path_length] where each element is one byte, or two characters,
except the last one which contains the rest. *)
let to_path key l =
let `Hex key = to_hex key in
String.sub key 0 2 :: String.sub key 2 2 ::