mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
make a distinction between Hash.state and Hash.t (and private type is bad here)
This commit is contained in:
parent
b56cdfa17a
commit
6872591708
2 changed files with 11 additions and 6 deletions
|
|
@ -25,8 +25,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
(** {1 Hash combinators} *)
|
(** {1 Hash combinators} *)
|
||||||
|
|
||||||
type t = int64
|
type t = int
|
||||||
type 'a hash_fun = 'a -> t -> t
|
type state = int64
|
||||||
|
type 'a hash_fun = 'a -> state -> state
|
||||||
|
|
||||||
let _r = 47
|
let _r = 47
|
||||||
let _m = 0xc6a4a7935bd1e995L
|
let _m = 0xc6a4a7935bd1e995L
|
||||||
|
|
|
||||||
|
|
@ -31,16 +31,20 @@ Combination of hashes based on the Murmur Hash (64 bits). See
|
||||||
|
|
||||||
(** {2 Definitions} *)
|
(** {2 Definitions} *)
|
||||||
|
|
||||||
type t = private int64
|
type t = int
|
||||||
|
(** A hash value is a positive integer *)
|
||||||
|
|
||||||
type 'a hash_fun = 'a -> t -> t
|
type state = int64
|
||||||
|
(** State required by the hash function *)
|
||||||
|
|
||||||
|
type 'a hash_fun = 'a -> state -> state
|
||||||
(** Hash function for values of type ['a], merging a fingerprint of the
|
(** Hash function for values of type ['a], merging a fingerprint of the
|
||||||
value into the state of type [t] *)
|
value into the state of type [t] *)
|
||||||
|
|
||||||
val init : t
|
val init : state
|
||||||
(** Initial value *)
|
(** Initial value *)
|
||||||
|
|
||||||
val finish : t -> int
|
val finish : state -> int
|
||||||
(** Extract a usable hash value *)
|
(** Extract a usable hash value *)
|
||||||
|
|
||||||
val apply : 'a hash_fun -> 'a -> int
|
val apply : 'a hash_fun -> 'a -> int
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue