diff options
Diffstat (limited to '')
| -rw-r--r-- | lib/concepts/Hash.ml | 4 | ||||
| -rw-r--r-- | lib/concepts/Hash.mli | 2 | ||||
| -rw-r--r-- | lib/concepts/Ordering.ml | 4 |
3 files changed, 3 insertions, 7 deletions
diff --git a/lib/concepts/Hash.ml b/lib/concepts/Hash.ml index b2ed4b2..922851a 100644 --- a/lib/concepts/Hash.ml +++ b/lib/concepts/Hash.ml @@ -5,7 +5,7 @@ type hash = Digestif.SHA256.t let size = 256/8 let compare h1 h2 = Digestif.SHA256.unsafe_compare h1 h2 - |> Ordering.of_int + |> Utilities.Ordering.of_int let hash_of_bytes bytes = Digestif.SHA256.digest_bytes bytes @@ -31,4 +31,4 @@ let power_of_two p = let pick n hash = let threshold = Digestif.SHA256.of_raw_string (power_of_two (256 - n)) in - compare hash threshold = Ordering.Smaller + compare hash threshold = Utilities.Ordering.Smaller diff --git a/lib/concepts/Hash.mli b/lib/concepts/Hash.mli index 0e71fda..ca50406 100644 --- a/lib/concepts/Hash.mli +++ b/lib/concepts/Hash.mli @@ -20,7 +20,7 @@ val of_raw_string : string -> hash val to_hum_string : hash -> string (** compare two hashes lexicographically *) -val compare : hash -> hash -> Ordering.ordering +val compare : hash -> hash -> Utilities.Ordering.t (** given two hashes, are they the same? *) val hash_equals : hash -> hash -> bool diff --git a/lib/concepts/Ordering.ml b/lib/concepts/Ordering.ml deleted file mode 100644 index 42b20e5..0000000 --- a/lib/concepts/Ordering.ml +++ /dev/null @@ -1,4 +0,0 @@ -type ordering = Equal | Smaller | Greater - -let of_int x = - if x < 0 then Smaller else if x > 0 then Greater else Equal |
