Function htpasswd::stringify [−][src]
pub fn stringify<'a>(map: IndexMap<&str, &str>) -> String
Transform the IndexMap of user/password pairs as create a htpasswd string.
Examples
use indexmap::IndexMap; use htpasswd::stringify; let output = "johndoe:$apr1$hdqQY4oe$6PtEz0XH6ORg.GPKCTpG31 janedoe:$apr1$D7qCR.yD$vfKO/2urv89Okpxl8VGpb/ "; let mut input = IndexMap::new(); input.insert("johndoe", "$apr1$hdqQY4oe$6PtEz0XH6ORg.GPKCTpG31"); input.insert("janedoe", "$apr1$D7qCR.yD$vfKO/2urv89Okpxl8VGpb/"); assert_eq!(output, stringify(input));