diff --git a/CHANGELOG.md b/CHANGELOG.md index 9789447..ad03ebe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +# v1.2.0 + +- Add `Mnemonic::parse_in_normalized_without_checksum_check` +- Make public `Mnemonic::normalize_utf8_cow` + # v1.1.0 - Add zerioze support through a feature (MSRV 1.51) diff --git a/Cargo.toml b/Cargo.toml index 5367452..0d8193e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bip39" -version = "1.1.0" +version = "1.2.0" authors = ["Steven Roose "] license = "CC0-1.0" homepage = "https://github.com/rust-bitcoin/rust-bip39/" diff --git a/src/lib.rs b/src/lib.rs index 5a8fa1d..35419c2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -180,7 +180,7 @@ impl Mnemonic { /// can be avoided for languages without special UTF8 characters. #[inline] #[cfg(feature = "std")] - fn normalize_utf8_cow<'a>(cow: &mut Cow<'a, str>) { + pub fn normalize_utf8_cow<'a>(cow: &mut Cow<'a, str>) { let is_nfkd = unicode_normalization::is_nfkd_quick(cow.as_ref().chars()); if is_nfkd != unicode_normalization::IsNormalized::Yes { *cow = Cow::Owned(cow.as_ref().nfkd().to_string()); @@ -435,7 +435,14 @@ impl Mnemonic { } /// Parse a mnemonic in normalized UTF8 in the given language without checksum check. - pub fn parse_without_checksum_check(language: Language, s: &str) -> Result { + /// + /// It is advised to use this method together with the utility methods + /// - [Mnemonic::normalize_utf8_cow] + /// - [Mnemonic::language_of] + pub fn parse_in_normalized_without_checksum_check( + language: Language, + s: &str, + ) -> Result { let nb_words = s.split_whitespace().count(); if is_invalid_word_count(nb_words) { return Err(Error::BadWordCount(nb_words));