IntersectMBO / bech32

Haskell implementation of the Bech32 address format (BIP 0173).
Apache License 2.0
42 stars 13 forks source link

Bech32 Windows binary fails to convert any input #40

Open Iridium-IO opened 3 years ago

Iridium-IO commented 3 years ago

Using the bech32 binary from cardano-wallet v2021-06-11

Piping any address in either upper or lower case fails, including the test inputs on the readme page.

Attempted commands (with or without the underscore, doesn't change outcome):

> echo 706174617465 | ./bech32 base16_
>>>bech32: user error (Unable to detect input encoding. Neither Base16, Bech32 nor Base58.)
> echo 706174617465 | ./bech32 base16_
>>>bech32: user error (Unable to detect input encoding. Neither Base16, Bech32 nor Base58.)
> "addr1q9.....kqwymqug" | ./bech32 addr
>>>bech32: user error (Unable to detect input encoding. Neither Base16, Bech32 nor Base58.)

I've also tried multiple examples provided around the forums for generating staking addresses from a wallet address with the same results.

rvl commented 3 years ago

Thanks for reporting @ImminentFate - I can reproduce this on Linux with:

$ printf "706174617465\n" | bech32 base16_
base16_1wpshgct5v5r5mxh0
$ printf "706174617465\r\n" | bech32 base16_ 
bech32: user error (Unable to detect input encoding. Neither Base16, Bech32 nor Base58.)

As a workaround, you can put your input in a file and save it with UNIX line endings (LF), instead of Windows line endings (CRLF).