ghpascon-rust
A personal Rust utility library.
Installation
Add to your Cargo.toml:
[]
= { = "https://github.com/ghpascon/ghpascon-rust" }
Modules
utils::regex
Utilities for regex-based validation.
regex_hex(value: &str, len: Option<usize>) -> bool
Validates whether a string is a valid hexadecimal value.
| Parameter | Type | Description |
|---|---|---|
value |
&str |
The string to validate |
len |
Option<usize> |
Expected length. Pass None to skip length check |
Returns true if the string contains only hex characters (0-9, a-f, A-F) and matches the expected length (if provided).
use regex_hex;
regex_hex; // true
regex_hex; // true
regex_hex; // false — wrong length
regex_hex; // false — invalid char
Examples
Scripts
| Script | Description |
|---|---|
scripts/deploy.sh |
Runs tests, bumps semver version, commits and pushes |
License
MIT