Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Base64-decode-data/Zkl/base64-decode-data-1.zkl
Normal file
9
Task/Base64-decode-data/Zkl/base64-decode-data-1.zkl
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
var [const] MsgHash=Import("zklMsgHash"), Curl=Import("zklCurl");
|
||||
|
||||
icon:=Curl().get("http://rosettacode.org/favicon.ico"); //-->(Data(4,331),693,0)
|
||||
icon=icon[0][icon[1],*]; // remove header
|
||||
iconEncoded:=MsgHash.base64encode(icon);
|
||||
iconDecoded:=MsgHash.base64decode(iconEncoded);
|
||||
File("rosettaCodeIcon.ico","wb").write(iconDecoded); # eyeball checking says good
|
||||
println("Is the Rosetta Code icon the same (byte for byte) encoded then decoded: ",
|
||||
icon==iconDecoded);
|
||||
4
Task/Base64-decode-data/Zkl/base64-decode-data-2.zkl
Normal file
4
Task/Base64-decode-data/Zkl/base64-decode-data-2.zkl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
msg,b64 := "Rosetta Code Base64 decode data task", MsgHash.base64encode(msg);
|
||||
println("Original: %s\nEncoded: %s\nBytes: %s\nDecoded: %s"
|
||||
.fmt(msg, b64.text, b64.bytes().apply("toString",16).concat(","),
|
||||
MsgHash.base64decode(b64).text));
|
||||
Loading…
Add table
Add a link
Reference in a new issue