15 stable releases
new 1.5.2 | Feb 17, 2025 |
---|---|
1.5.1 | Feb 8, 2025 |
1.4.1 | May 31, 2023 |
1.4.0 | Apr 20, 2023 |
1.0.1 | Sep 2, 2021 |
#832 in Encoding
503 downloads per month
21KB
305 lines
The hex-wrapper
is a collection of wrappers of the convertion between numbers and hex strings.
See the docs.rs for usages.
lib.rs
:
hex-wrapper
provides N-bit unsigned hexadecimal numbers.
Roughly speaking, Hex converts between uN
and (lowercase) String
hexadecimally.
Features
Defaults are all off.
rand
: Enables random constructorsHexN::rand()
andHexN::with_rng()
.serde
: Enables conversion used inserde
(e.g. for json).db
: Enables implementations ofdiesel
v2.2 traits.
Traits
Each hex type implements the following traits:
Default
(only forHexN
, not forNonZeroHexN
);FromStr
;TryFrom<&str>
;Debug
;Display
(henceToString
automatically);Into<String>
and converselyString
implementsFrom<HexN>
;Serialize
andDeserialize
(only when theserde
feature enabled).ToSql
,FromSql
,Queryable
andAsExpression
(only when thedb
feature enabled).
Dependencies
~0–780KB
~15K SLoC