proven-rs
Rust bindings for the proven library - safe, formally verified operations for math, crypto, parsing, and validation.
Installation
Add to your Cargo.toml:
[]
= "0.1"
Features
- Safe Math: Overflow detection, safe division, bounded integers
- Safe Strings: UTF-8 validation, injection-safe escaping (HTML, SQL, JS, URL, shell)
- Safe JSON: Exception-free parsing with validation
- Safe URLs: RFC 3986 compliant parsing
- Safe Email: RFC 5321/5322 validation
- Safe Paths: Traversal prevention
- Safe Crypto: Secure hashing stubs (use proper crypto libraries in production)
- Safe Passwords: Policy validation, strength analysis
- Safe DateTime: ISO 8601 parsing, date validation
- Safe Network: IPv4/IPv6 parsing, CIDR notation
Usage
use ;
// Safe math operations
let sum = add;
assert!; // Overflow detected
let div = div;
assert!; // Division by zero caught
// Safe string escaping
let escaped = escape_html;
assert!;
let sql = escape_sql;
assert_eq!;
// Email validation
assert!;
assert!;
License
AGPL-3.0-or-later