AdamNiederer / base100

base💯 - Encode your data into emoji
GNU Affero General Public License v3.0
276 stars 17 forks source link

index out of bounds: the len is 1 but the index is 2 when trying to decode #6

Open ignatenkobrain opened 6 years ago

ignatenkobrain commented 6 years ago
[brain@ignatenko-w541 ~]$ echo "👟👜👣👣👦🐁" | base100 -d
thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 2', src/main.rs:91:20
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Aborted (core dumped)
ignatenkobrain commented 6 years ago

weird enough when doing echo hello | base100 | base100 -d, everything works fine

AdamNiederer commented 6 years ago

Try echo -n "👟👜👣👣👦🐁". The newline at the end is probably causing the panic, because it's only one byte instead of four.

ignatenkobrain commented 6 years ago

Oh, that worked. Is there any way we can make newline to work? Also in output too.

AdamNiederer commented 6 years ago

Yeah, I can strip a newline off of the input and add one to the output. I'll have that in the next release.

MasterGroosha commented 5 years ago

Any news on this issue? I'm using "base100 --decode {path_to_file}" in my script, so I guess "echo -n" is not available for me. Is there an another workaround?

0xpr03 commented 5 years ago

echo "Hallo Tristan wie geht es dir?" | base100 > out.txt cat out.txt | base100 -d this way it works