helpers4 0.0.6

General-purpose Rust helpers, one crate, one feature per module (string, array, ...)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// This file is part of helpers4.
// Copyright (C) 2025 baxyz
// SPDX-License-Identifier: LGPL-3.0-or-later

use super::*;
use proptest::prelude::*;

proptest! {
    #[test]
    fn has_two_lowercase_hex_digits_per_byte(bytes in prop::collection::vec(any::<u8>(), 0..64)) {
        let out = encode(&bytes);
        prop_assert_eq!(out.len(), bytes.len() * 2);
        prop_assert!(out.chars().all(|c| matches!(c, '0'..='9' | 'a'..='f')));
    }
}