From 9f5c2aa00cc470bd20c0c29c5bfcb7a8451704c4 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 31 Dec 2024 17:04:52 -0800 Subject: [PATCH] Scripting: Expose MD5 checksum --- src/core/scripting.c | 3 +++ src/script/stdlib.c | 1 + 2 files changed, 4 insertions(+) diff --git a/src/core/scripting.c b/src/core/scripting.c index f409b4782..b36a91412 100644 --- a/src/core/scripting.c +++ b/src/core/scripting.c @@ -350,6 +350,9 @@ static struct mScriptValue* _mScriptCoreChecksum(const struct mCore* core, int t case mCHECKSUM_CRC32: size = 4; break; + case mCHECKSUM_MD5: + size = 16; + break; } if (!size) { return &mScriptValueNull; diff --git a/src/script/stdlib.c b/src/script/stdlib.c index 6e81cfd86..8fc1b1404 100644 --- a/src/script/stdlib.c +++ b/src/script/stdlib.c @@ -130,6 +130,7 @@ void mScriptContextAttachStdlib(struct mScriptContext* context) { }); mScriptContextExportConstants(context, "CHECKSUM", (struct mScriptKVPair[]) { mSCRIPT_CONSTANT_PAIR(mCHECKSUM, CRC32), + mSCRIPT_CONSTANT_PAIR(mCHECKSUM, MD5), mSCRIPT_KV_SENTINEL }); #ifdef M_CORE_GBA