September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
14
Task/SHA-256/BaCon/sha-256.bacon
Normal file
14
Task/SHA-256/BaCon/sha-256.bacon
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
PRAGMA INCLUDE <openssl/sha.h>
|
||||
PRAGMA LDFLAGS -lcrypto
|
||||
|
||||
OPTION MEMTYPE unsigned char
|
||||
|
||||
DECLARE result TYPE unsigned char*
|
||||
|
||||
result = SHA256("Rosetta code", 12, 0)
|
||||
|
||||
FOR i = 0 TO SHA256_DIGEST_LENGTH-1
|
||||
PRINT PEEK(result+i) FORMAT "%02x"
|
||||
NEXT
|
||||
|
||||
PRINT
|
||||
19
Task/SHA-256/C++/sha-256.cpp
Normal file
19
Task/SHA-256/C++/sha-256.cpp
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#include <iostream>
|
||||
#include <cryptopp/filters.h>
|
||||
#include <cryptopp/hex.h>
|
||||
#include <cryptopp/sha.h>
|
||||
|
||||
int main(int argc, char **argv){
|
||||
CryptoPP::SHA256 hash;
|
||||
std::string digest;
|
||||
std::string message = "Rosetta code";
|
||||
|
||||
CryptoPP::StringSource s(message, true,
|
||||
new CryptoPP::HashFilter(hash,
|
||||
new CryptoPP::HexEncoder(
|
||||
new CryptoPP::StringSink(digest))));
|
||||
|
||||
std::cout << digest << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -87,7 +87,7 @@ program sha256
|
|||
allocate(character(m) :: name)
|
||||
call get_command_argument(i, name)
|
||||
call sha256hash(name, hash, dwStatus, filesize)
|
||||
if (dwStatus*0 == 0) then
|
||||
if (dwStatus == 0) then
|
||||
do j = 1, SHA256LEN
|
||||
write(*, "(Z2.2)", advance="NO") hash(j)
|
||||
end do
|
||||
|
|
|
|||
2
Task/SHA-256/Halon/sha-256.halon
Normal file
2
Task/SHA-256/Halon/sha-256.halon
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
$var = "Rosetta code";
|
||||
echo sha2($var, 256);
|
||||
|
|
@ -3,7 +3,7 @@ standard = "764faf5c61ac315f1497f9dfa542713965b785e5cc2f707d6468d7d1124cdfcf"
|
|||
|
||||
using SHA
|
||||
|
||||
crypt = sha256(clear)
|
||||
crypt = join(map(hex, sha256("Rosetta code")))
|
||||
|
||||
println("Testing Julia's SHA-256:")
|
||||
if crypt == standard
|
||||
|
|
|
|||
12
Task/SHA-256/Kotlin/sha-256.kotlin
Normal file
12
Task/SHA-256/Kotlin/sha-256.kotlin
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// version 1.0.6
|
||||
|
||||
import java.security.MessageDigest
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val text = "Rosetta code"
|
||||
val bytes = text.toByteArray()
|
||||
val md = MessageDigest.getInstance("SHA-256")
|
||||
val digest = md.digest(bytes)
|
||||
for (byte in digest) print("%02x".format(byte))
|
||||
println()
|
||||
}
|
||||
2
Task/SHA-256/PowerShell/sha-256.psh
Normal file
2
Task/SHA-256/PowerShell/sha-256.psh
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Set-Content -Value "Rosetta code" -Path C:\Colors\blue.txt -NoNewline -Force
|
||||
Get-FileHash -Path C:\Colors\blue.txt -Algorithm SHA256
|
||||
2
Task/SHA-256/Zkl/sha-256.zkl
Normal file
2
Task/SHA-256/Zkl/sha-256.zkl
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
var MsgHash=Import("zklMsgHash");
|
||||
MsgHash.SHA256("Rosetta code")=="764faf5c61ac315f1497f9dfa542713965b785e5cc2f707d6468d7d1124cdfcf"
|
||||
Loading…
Add table
Add a link
Reference in a new issue