Renamed ./examples/external to ./examples/extensions. No code changes. (0.40.6)
This commit is contained in:
parent
28545fa8d4
commit
c68244d6f6
32 changed files with 40 additions and 41 deletions
28
examples/extensions/openssl/openssl_md5.fun
Executable file
28
examples/extensions/openssl/openssl_md5.fun
Executable 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 MD5 example
|
||||
// Enable with -DFUN_WITH_OPENSSL=ON during build for real hashing.
|
||||
|
||||
s = "abc"
|
||||
d = openssl_md5(s)
|
||||
print("md5(abc) = " + d)
|
||||
|
||||
// Another quick check (empty string)
|
||||
e = ""
|
||||
print("md5(\"\") = " + openssl_md5(e))
|
||||
|
||||
/* Expected output:
|
||||
md5(abc) = 900150983cd24fb0d6963f7d28e17f72
|
||||
md5("") = d41d8cd98f00b204e9800998ecf8427e
|
||||
*/
|
||||
28
examples/extensions/openssl/openssl_ripemd160.fun
Executable file
28
examples/extensions/openssl/openssl_ripemd160.fun
Executable 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
|
||||
*/
|
||||
28
examples/extensions/openssl/openssl_sha256.fun
Executable file
28
examples/extensions/openssl/openssl_sha256.fun
Executable 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 SHA-256 example
|
||||
// Enable with -DFUN_WITH_OPENSSL=ON during build for real hashing.
|
||||
|
||||
s = "abc"
|
||||
d = openssl_sha256(s)
|
||||
print("sha256(abc) = " + d)
|
||||
|
||||
// Another quick check (empty string)
|
||||
e = ""
|
||||
print("sha256(\"\") = " + openssl_sha256(e))
|
||||
|
||||
/* Expected output:
|
||||
sha256(abc) = ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
|
||||
sha256("") = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
|
||||
*/
|
||||
28
examples/extensions/openssl/openssl_sha512.fun
Executable file
28
examples/extensions/openssl/openssl_sha512.fun
Executable 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 SHA-512 example
|
||||
// Enable with -DFUN_WITH_OPENSSL=ON during build for real hashing.
|
||||
|
||||
s = "abc"
|
||||
d = openssl_sha512(s)
|
||||
print("sha512(abc) = " + d)
|
||||
|
||||
// Another quick check (empty string)
|
||||
e = ""
|
||||
print("sha512(\"\") = " + openssl_sha512(e))
|
||||
|
||||
/* Expected output:
|
||||
sha512(abc) = ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f
|
||||
sha512("") = cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e
|
||||
*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue