1
0
Fork 0
forked from fun/fun

Added OpenSSL RIPEMD-160 fun. (0.38.14)

This commit is contained in:
Johannes Findeisen 2026-02-19 14:19:17 +01:00
commit 6fa95f0d47
15 changed files with 144 additions and 9 deletions

View file

@ -4,7 +4,7 @@
* This file is part of the Fun programming language.
* https://fun-lang.xyz/
*
* Copyright 2025 Johannes Findeisen <you@hanez.org>
* Copyright 2026 Johannes Findeisen <you@hanez.org>
* Licensed under the terms of the Apache-2.0 license.
* https://opensource.org/license/apache-2-0
*

View file

@ -0,0 +1,28 @@
#!/usr/bin/env fun
/*
* This file is part of the Fun programming language.
* https://fun-lang.xyz/
*
* Copyright 2026 Johannes Findeisen <you@hanez.org>
* Licensed under the terms of the Apache-2.0 license.
* https://opensource.org/license/apache-2-0
*
* Added: 2026-02-19
*/
// OpenSSL RIPEMD-160 example
// Enable with -DFUN_WITH_OPENSSL=ON during build for real hashing.
s = "abc"
d = openssl_ripemd160(s)
print("ripemd160(abc) = " + d)
// Another quick check (empty string)
e = ""
print("ripemd160(\"\") = " + openssl_ripemd160(e))
/* Expected output (if RIPEMD-160 is available in your OpenSSL build):
ripemd160(abc) = 8eb208f7e05d987a9b044a8e98c6b087f15a0bfc
ripemd160("") = 9c1185a5c5e9fc54612808977ee8f548b2258d31
*/