include llama.cpp since there were some edits

This commit is contained in:
zefie committed 2026-11-01 16:32:35 -05:00
1 parent db7f28d087
commit 8c66990853
3918 files changed
+1640170 -1

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
#include "hash.h"
extern "C" {
#include "sha256/sha256.h"
}
static std::string to_hex(const unsigned char * digest, size_t len) {
static const char hex[] = "0123456789abcdef";
std::string out;
out.reserve(2*len);
for (size_t i = 0; i < len; ++i) {
out += hex[digest[i] >> 4];
out += hex[digest[i] & 0xf];
}
return out;
}
std::string hash_sha256_hex(const void * data, size_t len) {
unsigned char digest[SHA256_DIGEST_SIZE];
sha256_hash(digest, (const unsigned char *) data, len);
return to_hex(digest, SHA256_DIGEST_SIZE);
}