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 |
#52 in No standard library
56,377 downloads per month
Used in 73 crates
(7 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));