1
0
Fork 0
forked from fun/fun

The foundation for the internal standard library. (0.16.2)

This commit is contained in:
Johannes Findeisen 2025-10-01 03:30:26 +02:00
commit f0ed1d6761
13 changed files with 88 additions and 197 deletions

View file

@ -277,6 +277,9 @@ fun md5_hex(hexStr)
// Class wrapper to avoid global name collisions and show class usage
*/
#include <strings.fun>
class MD5()
// MD5 constants (as fields)
K = [
@ -517,3 +520,8 @@ class MD5()
bytes = this.from_hex(hexStr)
digest = this.md5_bytes(bytes)
return this.bytes_to_hex(digest)
fun md5_str(this, str)
bytes = string_to_bytes_ascii(str)
digest = this.md5_bytes(bytes)
return this.bytes_to_hex(digest)