hashes: Implement serialise.
This commit is contained in:
parent
78e8a06ec2
commit
20949c2832
1 changed files with 8 additions and 0 deletions
|
@ -28,6 +28,14 @@ pub fn parse_hash(root: &Element) -> Result<Hash, Error> {
|
|||
})
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue