SHA-256 is the recommended stronger alternative to SHA-1. See FIPS PUB 180-4 for implementation details.

Either by using a dedicated library or implementing the algorithm in your language, show that the SHA-256 digest of the string "Rosetta code" is: 764faf5c61ac315f1497f9dfa542713965b785e5cc2f707d6468d7d1124cdfcf

 
c-library crypto
 
s" ssl" add-lib
s" crypto" add-lib
 
\c #include <openssl/sha.h>
c-function sha256 SHA256 a n a -- a
 
end-c-library
 
: 2h.  ( n1 -- )  base @ swap hex s>d <# # # #> type base ! ;
 
: .digest ( a -- )
    32 bounds do  i c@ 2h.  loop space ;
 
s" Rosetta code" 0 sha256 .digest cr
bye
 