webchaussette 1.3.3

Fast, powerful, and easy-to-set-up WebSocket library
Documentation
1
2
3
4
5
6
7
pub fn unmask_payload(payload: &[u8], mask: &[u8; 4]) -> Vec<u8> {
    let mut unmasked_payload: Vec<u8> = Vec::with_capacity(payload.len());
    for (i, &byte) in payload.iter().enumerate() {
        unmasked_payload.push(byte ^ mask[i % 4]);
    }
    unmasked_payload
}