Skip to content

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

Open

Description

@igor-raits
[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)

Activity

  1. igor-raits commented on Feb 14, 2018

    @igor-raits
    Author

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

  2. AdamNiederer commented on Feb 14, 2018

    @AdamNiederer
    Owner

    Try echo -n "馃憻馃憸馃懀馃懀馃懄馃悂". The newline at the end is probably causing the panic, because it's only one byte instead of four.

  3. igor-raits commented on Feb 14, 2018

    @igor-raits
    Author

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

  4. AdamNiederer commented on Feb 14, 2018

    @AdamNiederer
    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.

  5. self-assigned this
    on Feb 14, 2018
  6. added this to the 0.5.0 milestone on Feb 14, 2018
  7. MasterGroosha commented on May 10, 2019

    @MasterGroosha

    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?

  8. 0xpr03 commented on Jul 9, 2019

    @0xpr03

    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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions