Created
August 12, 2016 14:48
-
-
Save ahalbert/f4536b2c4d03ab7cb7fadf95298a04c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#CORRECT: | |
say ("SSdtIGtpb".comb #Removes first element and last element, which are empty | |
==> map ( { @base64Table.grep($_, :k).Str.Int.base(2).Str }) #Maps each hex item to the corresponding binary string. grep returns Seq, so I have to convert it into a string to get the value. | |
==> map { binaryLeftPad($_, 6) } #Pads the binary elements | |
).join; #Turns @r into a single string | |
#Incorrect: | |
say ("SSdtIGtpb".comb #Removes first element and last element, which are empty | |
==> map { @base64Table.grep($_, :k).Str.Int.base(2).Str } #Maps each hex item to the corresponding binary string. grep returns Seq, so I have to convert it into a string to get the value. | |
==> map { binaryLeftPad($_, 6) } #Pads the binary elements | |
).join; #Turns @r into a single string | |
===SORRY!=== Error while compiling /Users/ahalbert/workspace/crypto/test.p6 | |
Bogus statement | |
at /Users/ahalbert/workspace/crypto/test.p6:19 | |
------> Table.grep($_, :k).Str.Int.base(2).Str }⏏ #Maps each hex item to the correspondin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment