1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
use exit;
use Write;
/// Returns a [String] of Hexadecimal-encoded bytes of &[u8] provided
///
/// Takes in:
/// &[u8]
///
/// Outputs:
/// [String]
///
/// # Example
///
/// ```
/// use febits::string_fe::bytes_to_hex_string;
///
/// let sample = b"This is rich";
///
/// assert_eq!(bytes_to_hex_string(sample), "546869732069732072696368");
/// assert_eq!(bytes_to_hex_string(b"Other data to hex String"), "4F74686572206461746120746F2068657820537472696E67");
/// ```
///
/// Returns the index of one Hex-encoded [String] pattern located inside of
/// another Hex-encoded [String] source
///
/// Returns 0 if the pattern was not found
///
/// Takes in:
/// &[String], &[String]
/// Where the &String is a String of Hex bytes
///
/// Outputs:
/// [usize]
///
///
/// # Example
///
/// ```
/// use febits::string_fe::{bytes_to_hex_string, index_hex_string_in_hex_string};
///
/// let source = bytes_to_hex_string(b"This is Rich text");
/// let pattern = bytes_to_hex_string(b"Rich");
///
/// assert_eq!(index_hex_string_in_hex_string(&source, &pattern), 8);
/// ```
///
/// Find a given [String] pattern inside of a given source of &[u8]
///
/// # Example
///
/// ```
/// use febits::string_fe::index_string_in_u8;
/// let input = b"This is Sample text";
/// let pat = String::from("Sample");
///
/// assert_eq!(index_string_in_u8(input, &pat), 8);
/// ```
///