From 7b60e267146cb8ea8a839b92e6feb4903bc9ae91 Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Mon, 18 Nov 2024 08:32:03 +1300 Subject: [PATCH] HashOutput::from_bytes() --- src/filestore/hash_output.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/filestore/hash_output.rs b/src/filestore/hash_output.rs index dc59480..b34f030 100644 --- a/src/filestore/hash_output.rs +++ b/src/filestore/hash_output.rs @@ -25,6 +25,10 @@ impl HashOutput { } } + pub fn from_bytes(bytes: [u8; 32]) -> HashOutput { + HashOutput(bytes) + } + pub fn to_pathbuf>(&self, base: P) -> PathBuf { let s = hex::encode(self.0); let mut output: PathBuf = PathBuf::new();