use std::collections::HashSet;
use indicatif::{ProgressBar, ProgressStyle};
pub(crate) fn is_alphanumeric(text: &str) -> bool {
if text.is_empty() {
return false;
}
text.chars().all(|c| c.is_alphanumeric())
}
pub(crate) fn contains_punctuation(text: &str) -> bool {
if text.is_empty() {
return false;
}
text.chars().any(|c| c.is_ascii_punctuation())
}
pub(crate) fn contains_numbers(text: &str) -> bool {
if text.is_empty() {
return false;
}
text.chars().any(|c| c.is_ascii_digit())
}
pub(crate) fn contains_special_characters(text: &str, special_characters: HashSet<char>) -> bool {
if text.is_empty() {
return false;
}
text.chars().any(|c| special_characters.contains(&c))
}
pub(crate) fn get_progress_bar(total: u64) -> ProgressBar {
let progress_bar = ProgressBar::new(total);
progress_bar.set_style(ProgressStyle::with_template("{spinner:.green} [{elapsed_precise}] [{wide_bar:.green/blue}] {human_pos}/{human_len} ({eta})")
.unwrap()
.progress_chars("##-"));
progress_bar
}