Function mles_utils::write_cid [] [src]

pub fn write_cid(cid: u32) -> Vec<u8>

Write a random connection id in network byte order.

Example

use mles_utils::{write_cid, select_cid, CIDL, do_hash};

let hashstr = "A string".to_string();
let hashable = vec![hashstr];
let key = do_hash(&hashable); 
let cidv = write_cid(select_cid(key));
assert_eq!(CIDL, cidv.len());