mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 13:05:53 +08:00
feat: update tempfile creation to use SHA-256 hash in filename for JuiceAgent-API
This commit is contained in:
1 parent
01c46c6b98
commit
41a8572c55
1 file changed
+14
-5
@@ -71,11 +71,20 @@ void entrypoint(const char* runtime_dir) {
|
||||
JuiceAgent::Config::Utils::print_loader_config(config);
|
||||
|
||||
// Save bytes to file
|
||||
std::string juiceagent_api_path = JuiceAgent::Utils::File::write_to_tempfile(
|
||||
JuiceAgent::Resource::juiceagent_api_bytes,
|
||||
JuiceAgent::Resource::juiceagent_api_bytes_len,
|
||||
JuiceAgent::Resource::juiceagent_api_bytes_name
|
||||
);
|
||||
std::string hash =
|
||||
JuiceAgent::Resource::juiceagent_api_bytes_sha256;
|
||||
|
||||
std::string file_name =
|
||||
hash.substr(0, 8) + "_" +
|
||||
JuiceAgent::Resource::juiceagent_api_bytes_name;
|
||||
|
||||
std::string juiceagent_api_path =
|
||||
JuiceAgent::Utils::File::write_to_tempfile(
|
||||
JuiceAgent::Resource::juiceagent_api_bytes,
|
||||
JuiceAgent::Resource::juiceagent_api_bytes_len,
|
||||
file_name
|
||||
);
|
||||
|
||||
PLOGD << "Saved JuiceAgent-API to: " << juiceagent_api_path;
|
||||
PLOGD << "JuiceAgent-API size: " << JuiceAgent::Resource::juiceagent_api_bytes_len;
|
||||
PLOGD << "JuiceAgent-API SHA256: " << JuiceAgent::Resource::juiceagent_api_bytes_sha256;
|
||||
|
||||
Reference in new issue
Block a user