This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/* | |
#cgo CFLAGS: -g -Wall | |
#include <stdlib.h> | |
*/ | |
import "C" | |
import ( | |
"bytes" | |
"encoding/json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use md5::{Md5, Digest}; | |
use std::fmt::Write; | |
fn build_uuid(username: &str) -> String { | |
let mut hasher = Md5::new(); | |
hasher.update(format!("OfflinePlayer:{}", username).as_bytes()); | |
let result = hasher.finalize(); | |
let mut data = result.into_iter().collect::<Vec<u8>>(); |