base layer hashing algorithms, fill out md5

This commit is contained in:
Ryan Fleury
2025-10-02 16:20:34 -07:00
parent 2d672d232f
commit 104e72999c
4 changed files with 82 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
// Copyright (c) Epic Games Tools
// Licensed under the MIT license (https://opensource.org/license/mit/)
////////////////////////////////
//~ rjf: Hash Functions
#if !defined(MD5_API)
# define MD5_API static
# include "third_party/md5/md5.c"
# include "third_party/md5/md5.h"
#endif
internal MD5
md5_from_data(String8 data)
{
MD5_CTX ctx = {0};
MD5_Init(&ctx);
MD5_Update(&ctx, (void*)data.str, data.size);
MD5 result = {0};
MD5_Final(result.u8, &ctx);
return result;
}
internal SHA1
sha1_from_data(String8 data)
{
SHA1 result = {0};
return result;
}
internal SHA256
sha256_from_data(String8 data)
{
SHA256 result = {0};
return result;
}