diff --git a/src/hashes.rs b/src/hashes.rs index f9e1e846..febf8b3f 100644 --- a/src/hashes.rs +++ b/src/hashes.rs @@ -28,6 +28,14 @@ pub fn parse_hash(root: &Element) -> Result { }) } +pub fn serialise(hash: &Hash) -> Element { + Element::builder("hash") + .ns(ns::HASHES) + .attr("algo", hash.algo.clone()) + .append(hash.hash.clone()) + .build() +} + #[cfg(test)] mod tests { use minidom::Element;