Returns true if given string is a valid ID. All IDs generated with `create_id()` should be considered valid.
(s: &str)
| 296 | /// |
| 297 | /// All IDs generated with `create_id()` should be considered valid. |
| 298 | pub(crate) fn validate_id(s: &str) -> bool { |
| 299 | let alphabet = base64::alphabet::URL_SAFE.as_str(); |
| 300 | s.chars().all(|c| alphabet.contains(c)) && s.len() > 10 && s.len() <= 32 |
| 301 | } |
| 302 | |
| 303 | pub(crate) fn validate_broadcast_secret(s: &str) -> bool { |
| 304 | let alphabet = base64::alphabet::URL_SAFE.as_str(); |
no test coverage detected