Skip to content

Commit

Permalink
chore: deprecated rust-crypto crate and use md5
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <xpf6677@163.com>
  • Loading branch information
Peefy committed Feb 18, 2024
1 parent a735a37 commit 15c5695
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 95 deletions.
170 changes: 80 additions & 90 deletions kclvm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion kclvm/config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ ahash = "0.7.2"
toml = "0.5.8"
ron = "0.7.0"
chrono = "0.4.19"
rust-crypto = "0.2.36"
glob = "0.3.0"
fslock = "0.2.1"
pathdiff = "0.2.1"
Expand All @@ -25,3 +24,4 @@ kclvm-utils = {path = "../utils"}
kclvm-ast = {path = "../ast"}
dirs = "5.0.0"
pcre2 = "0.2.4"
md-5 = "0.8.0"
7 changes: 3 additions & 4 deletions kclvm/config/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
extern crate chrono;
use super::modfile::KCL_FILE_SUFFIX;
use anyhow::Result;
use crypto::digest::Digest;
use crypto::md5::Md5;
use fslock::LockFile;
use kclvm_utils::pkgpath::{parse_external_pkg_name, rm_external_pkg_name};
use md5::{Digest, Md5};
use serde::{de::DeserializeOwned, Serialize};
use std::collections::HashMap;
use std::error;
Expand All @@ -21,7 +20,7 @@ const CACHE_INFO_FILENAME: &str = "info";
const KCL_SUFFIX_PATTERN: &str = "*.k";
pub const KCL_CACHE_PATH_ENV_VAR: &str = "KCL_CACHE_PATH";

pub type CacheInfo = String;
pub type CacheInfo = Vec<u8>;
pub type Cache = HashMap<String, CacheInfo>;

#[allow(dead_code)]
Expand Down Expand Up @@ -237,7 +236,7 @@ fn get_cache_info(path_str: &str) -> CacheInfo {
md5.input(buf.as_slice());
}
}
md5.result_str()
md5.result().to_vec()
}

pub fn get_pkg_realpath_from_pkgpath(root: &str, pkgpath: &str) -> String {
Expand Down

0 comments on commit 15c5695

Please sign in to comment.