3 stable releases
Uses old Rust 2015
1.1.1 | Mar 26, 2022 |
---|---|
1.1.0 | Jun 6, 2021 |
1.0.0 | Nov 2, 2018 |
#50 in No standard library
56,451 downloads per month
Used in 69 crates
(6 directly)
4KB
51 lines
hostname-validator
Rust crate for validating a hostname according to the IETF RFC 1123.
extern crate hostname_validator;
let valid = "VaLiD-HoStNaMe";
let invalid = "-invalid-name";
assert!(hostname_validator::is_valid(valid));
assert!(!hostname_validator::is_valid(invalid));
lib.rs
:
Validate a hostname according to the IETF RFC 1123.
extern crate hostname_validator;
let valid = "VaLiD-HoStNaMe";
let invalid = "-invalid-name";
assert!(hostname_validator::is_valid(valid));
assert!(!hostname_validator::is_valid(invalid));