summaryrefslogtreecommitdiff
path: root/080_blog/00040_Haskell/00065_Base64-Encoder
diff options
context:
space:
mode:
Diffstat (limited to '080_blog/00040_Haskell/00065_Base64-Encoder')
-rw-r--r--080_blog/00040_Haskell/00065_Base64-Encoder/base64.cast322
-rw-r--r--080_blog/00040_Haskell/00065_Base64-Encoder/index.md19
2 files changed, 341 insertions, 0 deletions
diff --git a/080_blog/00040_Haskell/00065_Base64-Encoder/base64.cast b/080_blog/00040_Haskell/00065_Base64-Encoder/base64.cast
new file mode 100644
index 0000000..63fece1
--- /dev/null
+++ b/080_blog/00040_Haskell/00065_Base64-Encoder/base64.cast
@@ -0,0 +1,322 @@
+{
+ "duration": 14.820928,
+ "title": null,
+ "env": {
+ "SHELL": "/bin/bash",
+ "TERM": "screen-256color"
+ },
+ "width": 106,
+ "stdout": [
+ [
+ 0.019966,
+ "miguel@megaloman:~$ "
+ ],
+ [
+ 1.524665,
+ "t"
+ ],
+ [
+ 0.08111,
+ "h"
+ ],
+ [
+ 0.095838,
+ "i"
+ ],
+ [
+ 0.118019,
+ "s"
+ ],
+ [
+ 0.086883,
+ " "
+ ],
+ [
+ 0.089573,
+ "i"
+ ],
+ [
+ 0.134283,
+ "s"
+ ],
+ [
+ 0.096031,
+ " "
+ ],
+ [
+ 0.114016,
+ "a"
+ ],
+ [
+ 0.166151,
+ " "
+ ],
+ [
+ 0.319094,
+ "l"
+ ],
+ [
+ 0.195916,
+ "o"
+ ],
+ [
+ 0.142042,
+ "c"
+ ],
+ [
+ 0.139961,
+ "a"
+ ],
+ [
+ 0.07801,
+ "l"
+ ],
+ [
+ 0.081012,
+ " "
+ ],
+ [
+ 0.094941,
+ "a"
+ ],
+ [
+ 0.120898,
+ "s"
+ ],
+ [
+ 0.107959,
+ "c"
+ ],
+ [
+ 0.115993,
+ "i"
+ ],
+ [
+ 0.137871,
+ "i"
+ ],
+ [
+ 0.205335,
+ "n"
+ ],
+ [
+ 0.108673,
+ "e"
+ ],
+ [
+ 0.127436,
+ "m"
+ ],
+ [
+ 0.123916,
+ "a"
+ ],
+ [
+ 0.244565,
+ "\r\n"
+ ],
+ [
+ 0.000482,
+ "bash: this: command not found\r\n"
+ ],
+ [
+ 0.000346,
+ "miguel@megaloman:~$ "
+ ],
+ [
+ 1.012884,
+ "this is a local asciinema"
+ ],
+ [
+ 0.230737,
+ "\r\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C"
+ ],
+ [
+ 0.140235,
+ "\u001b[1@e"
+ ],
+ [
+ 0.097927,
+ "\u001b[1@c"
+ ],
+ [
+ 0.188824,
+ "\u001b[1@j"
+ ],
+ [
+ 0.000974,
+ "\u001b[1@o"
+ ],
+ [
+ 0.421424,
+ "\b\u001b[1P"
+ ],
+ [
+ 0.117902,
+ "\b\u001b[1P"
+ ],
+ [
+ 0.208192,
+ "\u001b[1@h"
+ ],
+ [
+ 0.115112,
+ "\u001b[1@ "
+ ],
+ [
+ 0.012814,
+ "\u001b[1@o"
+ ],
+ [
+ 0.295287,
+ "\r\n"
+ ],
+ [
+ 0.000755,
+ "bash: ech: command not found\r\n"
+ ],
+ [
+ 0.000509,
+ "miguel@megaloman:~$ "
+ ],
+ [
+ 0.480858,
+ "ech othis is a local asciinema"
+ ],
+ [
+ 0.192018,
+ "\r\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C"
+ ],
+ [
+ 0.237975,
+ "\u001b[C"
+ ],
+ [
+ 0.118994,
+ "\u001b[C"
+ ],
+ [
+ 0.146091,
+ "\u001b[1P"
+ ],
+ [
+ 0.348015,
+ "\u001b[1P"
+ ],
+ [
+ 0.562446,
+ "\u001b[1@h"
+ ],
+ [
+ 0.437804,
+ "\u001b[C"
+ ],
+ [
+ 0.219332,
+ "\u001b[1@ "
+ ],
+ [
+ 0.220637,
+ "\r\n"
+ ],
+ [
+ 0.000486,
+ "this is a local asciinema\r\n"
+ ],
+ [
+ 0.000206,
+ "miguel@megaloman:~$ "
+ ],
+ [
+ 1.218406,
+ "m"
+ ],
+ [
+ 0.079499,
+ "c"
+ ],
+ [
+ 0.170894,
+ "\r\n"
+ ],
+ [
+ 0.00735,
+ "\u001b[?1049h\u001b[?1h\u001b="
+ ],
+ [
+ 0.000586,
+ "\u001b[1;9r\u001b[4l\u001b(B\u001b)0\u001b[9;1H\u001b[m\u000f\u001b[37m\u001b[40m\u001b[m\u000f\u001b[39;49m\r \r\u001b[?1l\u001b>\u001b[?1049l\u001b[?1049h\u001b[?1h\u001b="
+ ],
+ [
+ 0.021657,
+ "\u001b[?1001s\u001b[?1002h\u001b[?1006h\u001b[?2004h"
+ ],
+ [
+ 0.000429,
+ "\u001b[1;9r\u001b[4l\u001b(B\u001b)0\u001b[?1h\u001b=\u001b[m\u000f\u001b[39m\u001b[49m\u001b[1;9r\u001b[H\u001b[J\u001b[2;105H\u001b[1K \u001b[37m\u001b[40m|\u001b[2;106H"
+ ],
+ [
+ 0.000193,
+ "\b\u001b[39m\u001b[49m\u001b[1K \u001b[37m\u001b[40m╗\u001b[2;106H"
+ ],
+ [
+ 0.000114,
+ "\b\u001b[39m\u001b[49m\u001b[1K \u001b[37m\u001b[40m/\u001b[2;106H"
+ ],
+ [
+ 0.000129,
+ "\b\u001b[39m\u001b[49m\u001b[1K \u001b[37m\u001b[40m╗\u001b[2;106H"
+ ],
+ [
+ 0.000156,
+ "\u001b]0;mc [miguel@megaloman]:~\u0007\u001b>"
+ ],
+ [
+ 0.000337,
+ "\u001b[7;1H\u001b[39m\u001b[49mHint: Want your plain shell? Press C-o, and get back to MC with C-o again.\u001b[7;106H"
+ ],
+ [
+ 0.000251,
+ "\u001b]0;mc [miguel@megaloman]:~\u0007\u001b>"
+ ],
+ [
+ 0.000102,
+ "\u001b[1;1H\u001b[30m\u001b[47m Left File Command Options Right \u001b[2;1H\u001b[37m\u001b[40m╔«═\u001b[97m\u001b[105m ~ \u001b[37m\u001b[40m═════════════════════════════════════════⋅[^]»╗╔«═ ~ ═════════════════════════════════════════⋅[^]»\r\n║\u001b[97m↑n Name \u001b[37m│\u001b[97m Size \u001b[37m│\u001b[97mModify time \u001b[37m║║\u001b[97m↑n Name \u001b[37m│\u001b[97m Size \u001b[37m│\u001b[97mModify time \u001b[37m║\u001b[4;1H╟───────────────────────────────────────────────────╢╟───────────────────────────────────────────────────╢\u001b[5;1H║UP--DIR ║║"
+ ],
+ [
+ 1e-05,
+ "UP--DIR ║\u001b[6;1H╚═════════════════════════════════ 158G/234G (67%) ═╝╚═════════════════════════════════ 158G/234G (67%) ═╝\u001b[8;1H\u001b[39m\u001b[49mmiguel@megaloman:~$\u001b[84C\u001b[31m[^]\u001b[9;1H 1\u001b[97mHelp \u001b[31m 2\u001b[97mMenu \u001b[31m 3\u001b[97mView \u001b[31m 4\u001b[97mEdit \u001b[31m 5\u001b[97mCopy \u001b[31m 6\u001b[97mRenMov \u001b[31m 7\u001b[97mMkdir \u001b[31m 8\u001b[97mDelete \u001b[31m 9\u001b[97mPullDn \u001b[31m10\u001b[97mQuit \u001b[9;105H \b\u001b[4h \u001b[4l\u001b[8;21H"
+ ],
+ [
+ 1.221371,
+ "\u001b[1;1H\u001b[39m \u001b[2;1H \u001b[3;1H \u001b[4;1H \u001b[5;1H \u001b[6;1H \u001b[7;1H \u001b[8;1H \u001b[9;1H \u001b[1;106H\u001b[?2"
+ ],
+ [
+ 4.5e-05,
+ "004l\u001b[?1006l\u001b[?1002l\u001b[?1001r"
+ ],
+ [
+ 0.000416,
+ "\u001b[?1l\u001b>\u001b[9;1H\u001b[m\u000f\u001b[39;49m\r \r\u001b[?1l\u001b>\u001b[?1049l\u001b[39;49m"
+ ],
+ [
+ 0.000319,
+ "\r\n"
+ ],
+ [
+ 0.001118,
+ "miguel@megaloman:~$ "
+ ],
+ [
+ 0.791031,
+ "e"
+ ],
+ [
+ 0.62602,
+ "\b\u001b[K"
+ ]
+ ],
+ "height": 9,
+ "command": null,
+ "version": 1
+} \ No newline at end of file
diff --git a/080_blog/00040_Haskell/00065_Base64-Encoder/index.md b/080_blog/00040_Haskell/00065_Base64-Encoder/index.md
new file mode 100644
index 0000000..0ede6cf
--- /dev/null
+++ b/080_blog/00040_Haskell/00065_Base64-Encoder/index.md
@@ -0,0 +1,19 @@
+Miguel's Base64 Encoder
+=======================
+ February 19, 2018
+
+Coded on a winter afternoon to fully understand **base64 encoding** and play with
+**Haskell**, which is always an indisputable pleasure.
+
+Coded in _big anger_, due to Nick's fairy tales about saving his encrypted binary
+data in plain ASCII configuration files, featuring strange letters and
+non-printable characters. :P
+
+<asciinema-player cols="106" rows="9" preload="true" theme="solarized-dark" autoplay="true" src="base64.cast"></asciinema-player>
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.haskell .numberLines}
+{BEGIN:EMBED}
+https://gitweb.softwarefools.com/?p=miguel/haskell.git;a=blob_plain;f=base64/base64.hs
+{END:EMBED}
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The above code was auto-fetched from: <https://gitweb.softwarefools.com/?p=miguel/haskell.git;a=blob_plain;f=base64/base64.hs>