pub fn xor(addr: &SocketAddr, token: &[u8]) -> SocketAddr
Expand description
ยงUnit Test
use faster_stun::attribute::address::*;
use std::net::SocketAddr;
let source: SocketAddr = "192.168.0.107:1".parse().unwrap();
let res: SocketAddr = "225.186.164.41:8467".parse().unwrap();
let token: [u8; 12] = [
0x6c, 0x46, 0x62, 0x54, 0x75, 0x4b, 0x44, 0x51, 0x46, 0x48, 0x4c, 0x71,
];
let addr = xor(&source, &token);
assert_eq!(addr, res);