()
| 8 | use uuid::{Context, Uuid, timestamp::Timestamp}; |
| 9 | |
| 10 | fn get_node_id() -> [u8; 6] { |
| 11 | match get_mac_address() { |
| 12 | Ok(Some(_ma)) => get_mac_address().unwrap().unwrap().bytes(), |
| 13 | // os_random is expensive, but this is only ever called once |
| 14 | _ => rustpython_common::rand::os_random::<6>(), |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | #[pyfunction] |
| 19 | fn generate_time_safe() -> (Vec<u8>, PyNone) { |