move name'calculation' into backend
This commit is contained in:
@@ -470,11 +470,11 @@ const NAMES: [&str; 467] = [
|
||||
"Yellow",
|
||||
];
|
||||
|
||||
pub(crate) fn get_name_by_uuid(uuid: &str) -> &str {
|
||||
pub(crate) fn get_name_by_uuid(uuid: &str) -> String {
|
||||
let mut hasher = DefaultHasher::new();
|
||||
uuid.hash(&mut hasher);
|
||||
let hash = hasher.finish();
|
||||
|
||||
let index = (hash % NAMES.len() as u64) as usize;
|
||||
NAMES[index]
|
||||
format!("Anonymous {}", NAMES[index])
|
||||
}
|
||||
|
Reference in New Issue
Block a user