yubihsm 0.42.1

Pure Rust client for YubiHSM2 devices with support for HTTP and USB-based access to the device. Supports most HSM functionality including ECDSA, Ed25519, HMAC, and RSA.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! UUID functionality

use rand_core::{OsRng, RngCore};
use uuid::Builder;
pub use uuid::Uuid;

/// Create a random UUID
pub fn new_v4() -> Uuid {
    let mut bytes = [0; 16];
    OsRng.fill_bytes(&mut bytes);
    Builder::from_random_bytes(bytes).into_uuid()
}