diff options
| author | mat <git@matdoes.dev> | 2025-12-09 01:27:44 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-12-09 13:26:12 +1100 |
| commit | ba3a88336a074f902667d3e13471af62b431da04 (patch) | |
| tree | 4c7052376abfccff8c090192c90d92280154f9c5 /azalea-auth/src | |
| parent | 4fde1ecd61c0f67057df0c55a45ba398da580ae1 (diff) | |
| download | azalea-drasl-ba3a88336a074f902667d3e13471af62b431da04.tar.xz | |
move offline-mode uuid generation to azalea-crypto
Diffstat (limited to 'azalea-auth/src')
| -rw-r--r-- | azalea-auth/src/lib.rs | 1 | ||||
| -rw-r--r-- | azalea-auth/src/offline.rs | 17 |
2 files changed, 0 insertions, 18 deletions
diff --git a/azalea-auth/src/lib.rs b/azalea-auth/src/lib.rs index a024f4d5..6cbee318 100644 --- a/azalea-auth/src/lib.rs +++ b/azalea-auth/src/lib.rs @@ -12,4 +12,3 @@ pub mod sessionserver; pub use auth::*; pub mod game_profile; -pub mod offline; diff --git a/azalea-auth/src/offline.rs b/azalea-auth/src/offline.rs deleted file mode 100644 index 737555e8..00000000 --- a/azalea-auth/src/offline.rs +++ /dev/null @@ -1,17 +0,0 @@ -use md5::{Digest, Md5}; -use uuid::Uuid; - -pub fn generate_uuid(username: &str) -> Uuid { - uuid::Builder::from_md5_bytes(hash(format!("OfflinePlayer:{username}").as_bytes())).into_uuid() -} - -fn hash(data: &[u8]) -> [u8; 16] { - let mut hasher = Md5::new(); - - hasher.update(data); - - let mut bytes = [0; 16]; - bytes.copy_from_slice(&hasher.finalize()[..16]); - - bytes -} |
