Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ignatenkobrain opened this issue Feb 14, 2018 · 6 comments
Assignees
Milestone

Comments

@ignatenkobrain
Copy link

[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
Copy link
Author

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

@AdamNiederer
Copy link
Owner

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

@ignatenkobrain
Copy link
Author

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

@AdamNiederer
Copy link
Owner

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

@AdamNiederer AdamNiederer self-assigned this Feb 14, 2018
@AdamNiederer AdamNiederer added this to the 0.5.0 milestone Feb 14, 2018
@MasterGroosha
Copy link

MasterGroosha commented May 10, 2019

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
Copy link

0xpr03 commented Jul 9, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants