Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/oid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::{convert::TryInto, time::SystemTime};

use hex::{self, FromHexError};
use once_cell::sync::Lazy;
use rand::{thread_rng, Rng};
use rand::{random, thread_rng, Rng};

const TIMESTAMP_SIZE: usize = 4;
const PROCESS_ID_SIZE: usize = 5;
Expand Down Expand Up @@ -253,7 +253,7 @@ impl ObjectId {

/// Generate a random 5-byte array.
fn gen_process_id() -> [u8; 5] {
static BUF: Lazy<[u8; 5]> = Lazy::new(|| thread_rng().gen());
static BUF: Lazy<[u8; 5]> = Lazy::new(random);

*BUF
}
Expand Down