nettext/src/lib.rs

20 lines
494 B
Rust
Raw Normal View History

2022-11-17 15:35:06 +00:00
pub mod crypto;
pub mod dec;
2022-11-17 16:55:50 +00:00
pub mod enc;
// ---- syntactic elements of the data format ----
pub(crate) const DICT_OPEN: u8 = b'{';
pub(crate) const DICT_CLOSE: u8 = b'}';
pub(crate) const DICT_ASSIGN: u8 = b'=';
pub(crate) const DICT_DELIM: u8 = b',';
pub(crate) const STR_EXTRA_CHARS: &[u8] = b"._-*?";
pub(crate) fn is_string_char(c: u8) -> bool {
c.is_ascii_alphanumeric() || STR_EXTRA_CHARS.contains(&c)
}
pub(crate) fn is_whitespace(c: u8) -> bool {
c.is_ascii_whitespace()
}