yubihsm 0.35.0

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
13
14
15
16
//! UUID functionality

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

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

    Builder::from_bytes(bytes)
        .set_variant(Variant::RFC4122)
        .set_version(Version::Random)
        .build()
}