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