mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 02:05:30 +00:00
WIP: work on http load test (now partly working) and http protocol
This commit is contained in:
parent
5b0d364ccf
commit
d1e9d24773
10 changed files with 326 additions and 226 deletions
|
|
@ -6,6 +6,22 @@ use smartstring::{SmartString, LazyCompact};
|
|||
use super::response::ResponsePeer;
|
||||
|
||||
|
||||
pub fn urlencode_20_bytes(input: [u8; 20]) -> Vec<u8> {
|
||||
let mut tmp = [0u8; 40];
|
||||
|
||||
hex::encode_to_slice(&input, &mut tmp);
|
||||
|
||||
let mut output = Vec::with_capacity(60);
|
||||
|
||||
for chunk in tmp.chunks_exact(2){
|
||||
output.push(b'%');
|
||||
output.extend_from_slice(chunk);
|
||||
}
|
||||
|
||||
output
|
||||
}
|
||||
|
||||
|
||||
/// Not for serde
|
||||
pub fn deserialize_20_bytes(value: SmartString<LazyCompact>) -> anyhow::Result<[u8; 20]> {
|
||||
let mut arr = [0u8; 20];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue