fix(java): use ext::hash() instead

This commit is contained in:
zaaarf 2024-08-14 19:17:25 +02:00
parent 39f69cc418
commit a5502d1f1f
No known key found for this signature in database
GPG key ID: 102E445F4C3F829B

View file

@ -1,5 +1,4 @@
use jni::{objects::{JClass, JObject, JString, JValueGen}, sys::{jlong, jobject, jstring}, JNIEnv};
use xxhash_rust::xxh3::xxh3_64;
use crate::api::Controller;
@ -129,7 +128,6 @@ pub extern "system" fn Java_mp_code_data_TextChange_hash<'local>(
let content: String = env.get_string(&content)
.map(|s| s.into())
.jexcept(&mut env);
let hash = xxh3_64(content.as_bytes());
let hash = crate::ext::hash(content.as_bytes());
i64::from_ne_bytes(hash.to_ne_bytes())
}