safename 0.1.0

Filename and path validation for security hardening
Documentation
//! Constants for safename validation and sanitization.

// See lookup.rs for the constant byte lookup tables.

/// Unicode replacement character (U+FFFD) encoded as UTF-8.
pub const REPLACEMENT_CHAR: &[u8] = &[0xEF, 0xBF, 0xBD];

/// ASCII underscore as a single-byte replacement option.
pub const REPLACEMENT_UNDERSCORE: &[u8] = b"_";

/// Default maximum filename length (NAME_MAX on most Unix systems).
pub const DEFAULT_MAX_FILE_LEN: usize = 255;

/// Default maximum path length (PATH_MAX on most Unix systems).
pub const DEFAULT_MAX_PATH_LEN: usize = 4096;

/// Current directory special filename.
pub const DOT: &[u8] = b".";

/// Parent directory special filename.
pub const DOTDOT: &[u8] = b"..";