From 79c691e1c0b69905074efc0a018240ae49c5b635 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Fri, 21 Apr 2017 01:30:29 +0100 Subject: [PATCH] ecaps2: Add a TODO about changing algo into an enum. --- src/ecaps2.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ecaps2.rs b/src/ecaps2.rs index e2e2de18..5b74beaa 100644 --- a/src/ecaps2.rs +++ b/src/ecaps2.rs @@ -81,8 +81,9 @@ pub fn convert_element(root: &Element) -> Result, Error> { Ok(final_string) } +// TODO: make algo into an enum. pub fn hash_ecaps2(data: &[u8], algo: &str) -> String { - match algo.as_ref() { + match algo { "sha-256" => { let mut hasher = Sha256::default(); hasher.input(data);