Crates.io | array-bytes |
lib.rs | array-bytes |
version | |
source | src |
created_at | 2020-11-23 02:57:58.740407 |
updated_at | 2024-12-07 18:00:52.057791 |
description | A collection of array/bytes/hex utilities. |
homepage | https://hack.ink/array-bytes |
repository | https://github.com/hack-ink/array-bytes |
max_upload_size | |
id | 315207 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
TryFromHex
traitAsRef<[u8]> -> isize
AsRef<[u8]> -> i8
AsRef<[u8]> -> i16
AsRef<[u8]> -> i32
AsRef<[u8]> -> i64
AsRef<[u8]> -> i128
AsRef<[u8]> -> usize
AsRef<[u8]> -> u8
AsRef<[u8]> -> u16
AsRef<[u8]> -> u32
AsRef<[u8]> -> u64
AsRef<[u8]> -> u128
AsRef<[u8]> -> [u8; N]
, N = { [1, 64], 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536 }
AsRef<[u8]> -> Vec<u8>
Hex
traitisize -> String
i8 -> String
i16 -> String
i32 -> String
i64 -> String
i128 -> String
usize -> String
u8 -> String
u16 -> String
u32 -> String
u64 -> String
u128 -> String
Vec<u8> -> String
[u8; N] -> String
, N = { [1, 64], 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536 }
&[u8] -> String
slice
prefixed functionsArray
from Slice
&[T] -> [T; N]
&[T] -> &[T; N]
Slice
to G
&[T] -> G
&[0_u8, ...] -> [u8; 20] -> H160
prefix
and suffix
functionsN
.bytes
prefixed functionsAsRef<[u8]> -> String
hex
prefixed functionsHexBytes
to hex
&[u8] -> &str
b"0x..." -> "0x..."
Array
&str -> [u8; N]
AsRef<[u8]> -> Vec<u8>
Slice
AsRef<[u8]> -> &[u8]
T
AsRef<[u8]> -> T
"0x..." -> [u8; 20] -> H160
vec
prefixed functionsArray
from Vec
Vec<T> -> [T; N]
Vec
to G
Vec<T> -> G
vec![0_u8, ...] -> [u8; 20] -> H160
serde
)#[serde(deserialize_with = "array_bytes::hex_deserialize_n_into")]
S -> T
"0x..." -> H160
#[serde(deserialize_with = "array_bytes::de_try_from_hex")]
S -> impl TryFromHex
"0xA" -> 10_u32
#[serde(serialize_with = "array_bytes::ser_hex/array_bytes::ser_hex_without_prefix")]
S -> impl Hex
"0x00" -> vec![0_u8]
array_bytes::bytes2hex time: [26.426 µs 26.473 µs 26.518 µs]
Found 4 outliers among 100 measurements (4.00%)
2 (2.00%) low mild
1 (1.00%) high mild
1 (1.00%) high severe
const_hex::encode time: [994.78 ns 1.0084 µs 1.0232 µs]
faster_hex::hex_string time: [11.728 µs 11.769 µs 11.815 µs]
faster_hex::hex_encode_fallback
time: [11.704 µs 11.737 µs 11.773 µs]
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
hex::encode time: [86.105 µs 86.250 µs 86.433 µs]
Found 14 outliers among 100 measurements (14.00%)
1 (1.00%) low severe
4 (4.00%) low mild
6 (6.00%) high mild
3 (3.00%) high severe
rustc_hex::to_hex time: [44.486 µs 45.538 µs 46.723 µs]
Found 16 outliers among 100 measurements (16.00%)
1 (1.00%) low mild
2 (2.00%) high mild
13 (13.00%) high severe
array_bytes::hex2bytes time: [43.576 µs 44.529 µs 45.404 µs]
Performance has regressed.
Found 11 outliers among 100 measurements (11.00%)
7 (7.00%) low mild
4 (4.00%) high mild
array_bytes::hex2bytes_unchecked
time: [64.190 µs 65.311 µs 66.359 µs]
array_bytes::hex2slice time: [45.484 µs 46.988 µs 48.736 µs]
Performance has regressed.
Found 12 outliers among 100 measurements (12.00%)
2 (2.00%) high mild
10 (10.00%) high severe
array_bytes::hex2slice_unchecked
time: [62.339 µs 63.317 µs 64.279 µs]
Performance has regressed.
const_hex::decode time: [13.601 µs 13.629 µs 13.665 µs]
Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) low mild
1 (1.00%) high severe
faster_hex::hex_decode time: [28.015 µs 28.061 µs 28.110 µs]
Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
faster_hex::hex_decode_unchecked
time: [11.782 µs 11.797 µs 11.812 µs]
Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) low severe
1 (1.00%) low mild
faster_hex::hex_decode_fallback
time: [11.748 µs 11.767 µs 11.785 µs]
Found 7 outliers among 100 measurements (7.00%)
2 (2.00%) low severe
4 (4.00%) low mild
1 (1.00%) high mild
hex::decode time: [93.055 µs 94.781 µs 96.583 µs]
hex::decode_to_slice time: [31.949 µs 33.509 µs 35.285 µs]
Found 13 outliers among 100 measurements (13.00%)
5 (5.00%) high mild
8 (8.00%) high severe
rustc_hex::from_hex time: [105.99 µs 108.05 µs 110.11 µs]
Licensed under either of Apache-2.0 or GPL-3.0 at your option.