aboutsummaryrefslogtreecommitdiff
path: root/azalea-crypto/src/offline.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-crypto/src/offline.rs')
-rw-r--r--azalea-crypto/src/offline.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/azalea-crypto/src/offline.rs b/azalea-crypto/src/offline.rs
index 737555e8..b0e7c12b 100644
--- a/azalea-crypto/src/offline.rs
+++ b/azalea-crypto/src/offline.rs
@@ -1,6 +1,9 @@
+//! Offline-mode UUID generation.
+
use md5::{Digest, Md5};
use uuid::Uuid;
+/// Return what the offline-mode UUIDv3 for the given username would be.
pub fn generate_uuid(username: &str) -> Uuid {
uuid::Builder::from_md5_bytes(hash(format!("OfflinePlayer:{username}").as_bytes())).into_uuid()
}