From 2f7ddbb40133d84ebe4c2ba6458503b56edc70f5 Mon Sep 17 00:00:00 2001 From: Ray Foss Date: Thu, 26 Jul 2018 13:09:30 -0500 Subject: [PATCH 1/4] README: Wrong syntax on mac echo ``` ECHO(1) BSD General Commands Manual ECHO(1) NAME echo -- write arguments to the standard output SYNOPSIS echo [-n] [string ...] ``` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 69b6b8e..1827100 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Encoding (Python) Decoding (Mac) -`echo "[URL]" -n | sed 's/^.*#[^\/]*\///g' | base64 -D | lzma -d ` +`echo -n "[URL]" | sed 's/^.*#[^\/]*\///g' | base64 -D | lzma -d ` Decoding (Linux) From 4212ade51073c75b31e9ec35df463f2e16b3763a Mon Sep 17 00:00:00 2001 From: Ray Foss Date: Thu, 26 Jul 2018 13:21:21 -0500 Subject: [PATCH 2/4] Readme: Add support for '?' sites https://itty.bitty.site/#Easy_As_Do_Re_Mi/?XQAAAAIDAAAAAAAAAAAwmIikSo6f//ZjgAA= --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1827100..e969b10 100644 --- a/README.md +++ b/README.md @@ -43,11 +43,11 @@ Encoding (Python) Decoding (Mac) -`echo -n "[URL]" | sed 's/^.*#[^\/]*\///g' | base64 -D | lzma -d ` +`echo -n "[URL]" | sed -E 's/^.*#[^\/]*\/\??//g' | base64 -D | lzma -d ` Decoding (Linux) -`echo -n "[URL]" | sed 's/^.*#[^\/]*\///g' | base64 -d | lzma -d` +`echo -n "[URL]" | sed -E 's/^.*#[^\/]*\/\??//g' | base64 -d | lzma -d` Decoding (Win) From 9264abce08bf88d423f113fb097865f4ddf12a07 Mon Sep 17 00:00:00 2001 From: Ray Foss Date: Thu, 26 Jul 2018 15:33:06 -0500 Subject: [PATCH 3/4] ReadMe: Node script for encoding https://runkit.com/hesygolu/site-gen-script --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e969b10..4a92c86 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,10 @@ Encoding (Python) `base64.b64encode(lzma.compress(bytes("hello world",encoding="utf-8"), format=lzma.FORMAT_ALONE, preset=9))` +Encoding (Node.js) + +`'https://itty.bitty.site/#/'+Buffer.from(require("lzma").compress("Hello World", 9)).toString('base64')` + Decoding (Mac) `echo -n "[URL]" | sed -E 's/^.*#[^\/]*\/\??//g' | base64 -D | lzma -d ` @@ -49,6 +53,6 @@ Decoding (Linux) `echo -n "[URL]" | sed -E 's/^.*#[^\/]*\/\??//g' | base64 -d | lzma -d` -Decoding (Win) +Decoding (Win Git/WSL) `echo -n "[URL]" | sed 's/^.*#[^\/]*\///g' | base64 -d | xz --format=lzma -d` From 59f3b8c78d6fc9a610b32881acc3e58774271d15 Mon Sep 17 00:00:00 2001 From: Ray Foss Date: Thu, 26 Jul 2018 15:43:41 -0500 Subject: [PATCH 4/4] It still needs to be installed... for consistency with the Python version, which has the exact same issue --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4a92c86..088b72f 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Encoding (Python) Encoding (Node.js) -`'https://itty.bitty.site/#/'+Buffer.from(require("lzma").compress("Hello World", 9)).toString('base64')` +`'https://itty.bitty.site/#/'+Buffer.from(lzma.compress("Hello World", 9)).toString('base64')` Decoding (Mac)