From 0122ee2639dd6f7cda8aff7df5fbbabd0bfa62a6 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Tue, 13 Feb 2024 14:27:13 +0100 Subject: [PATCH 1/2] yocaml_unix: use digestif for SHA256 computation instead of cryptokit --- lib/yocaml_unix/dune | 2 +- lib/yocaml_unix/runtime.ml | 3 +-- yocaml_unix.opam | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/yocaml_unix/dune b/lib/yocaml_unix/dune index b08caaf..5197dbc 100644 --- a/lib/yocaml_unix/dune +++ b/lib/yocaml_unix/dune @@ -1,7 +1,7 @@ (library (name yocaml_unix) (public_name yocaml_unix) - (libraries cryptokit unix yocaml logs cohttp-lwt-unix conduit-lwt)) + (libraries digestif unix yocaml logs cohttp-lwt-unix conduit-lwt)) (documentation (package yocaml_unix)) diff --git a/lib/yocaml_unix/runtime.ml b/lib/yocaml_unix/runtime.ml index 0765f2a..b883afb 100644 --- a/lib/yocaml_unix/runtime.ml +++ b/lib/yocaml_unix/runtime.ml @@ -78,8 +78,7 @@ let read_dir path = ;; let hash value = - let open Cryptokit in - value |> hash_string (Hash.sha256 ()) |> transform_string (Hexa.encode ()) + Digestif.SHA256.(digest_string value |> to_hex) ;; let content_changes path new_content = diff --git a/yocaml_unix.opam b/yocaml_unix.opam index 2d64bc4..28efde7 100644 --- a/yocaml_unix.opam +++ b/yocaml_unix.opam @@ -25,7 +25,7 @@ depends: [ "dune" { >= "2.8" } "odoc" {with-doc} "preface" { >= "1.0.0" } - "cryptokit" { >= "1.16.1" } + "digestif" "logs" {>= "0.7.0" } "conduit-lwt" { >= "4.0.0" } "cohttp-lwt-unix" { >= "4.0.0" } From d36972c65faaf9599d36f8f613fdc30c81ba0fcc Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Thu, 15 Feb 2024 14:55:30 +0100 Subject: [PATCH 2/2] add changes entry --- CHANGES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index d2bca57..402df7f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,8 @@ +### dev (unreleased) + +#### yocaml_unix +- Use digestif instead of cryptokit (#50 @hannesm, review by @xvw) + ### v1.0.0 2023-11-15 Paris (France) - First release of YOCaml