perf: changed md5 library to use asm instructions
This commit is contained in:
parent
c8b905d263
commit
e662699b99
3 changed files with 6 additions and 4 deletions
|
@ -19,14 +19,14 @@ enum-ordinalize = { version = "3.1", optional = true }
|
|||
|
||||
wincompatlib = { version = "0.2", optional = true }
|
||||
lazy_static = { version = "1.4", optional = true }
|
||||
md5 = { version = "0.7", optional = true }
|
||||
md-5 = { version = "0.10", features = ["asm"], optional = true }
|
||||
|
||||
[features]
|
||||
states = []
|
||||
config = ["dep:serde", "dep:serde_json", "dep:enum-ordinalize"]
|
||||
components = ["dep:wincompatlib", "dep:lazy_static"]
|
||||
game = ["components", "config"]
|
||||
fps-unlocker = ["dep:md5"]
|
||||
fps-unlocker = ["dep:md-5"]
|
||||
|
||||
default = ["all"]
|
||||
all = ["states", "config", "components", "game", "fps-unlocker"]
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 96cee069953819eb0ee758298c05b5eb2b8f6b7f
|
||||
Subproject commit ef498b2e16f9b4cc4c1ee6357e73caf4fbc81dec
|
|
@ -2,6 +2,8 @@ use std::path::PathBuf;
|
|||
|
||||
use anime_game_core::installer::downloader::Downloader;
|
||||
|
||||
use md5::{Md5, Digest};
|
||||
|
||||
use crate::config::game::enhancements::fps_unlocker::config::Config as FpsUnlockerConfig;
|
||||
|
||||
pub mod config_schema;
|
||||
|
@ -26,7 +28,7 @@ impl FpsUnlocker {
|
|||
pub fn from_dir<T: Into<PathBuf> + std::fmt::Debug>(dir: T) -> anyhow::Result<Option<Self>> {
|
||||
let dir = dir.into();
|
||||
|
||||
let hash = format!("{:x}", md5::compute(std::fs::read(dir.join("unlocker.exe"))?));
|
||||
let hash = format!("{:x}", Md5::digest(std::fs::read(dir.join("unlocker.exe"))?));
|
||||
|
||||
Ok(if hash == LATEST_INFO.0 {
|
||||
Some(Self { dir })
|
||||
|
|
Loading…
Reference in a new issue