jeramyRR
Problems properly decoding a base64 encoded string
I am trying to decode an Azure Storage Key that’s supposedly base64 encoded, but I’m getting all kinds of wonkey characters. Example:
Base.decode64! "ZG2p8/z2ATu8NVLBXmeFtkX9chpkbk2EK9fH4qVKxvC//mSlIdsqzvZpNa4k7tPPR86RmiGkdi0BLwAEtPbkXA==" |> String.codepoints
Results in:
[
"d",
"m",
<<169>>,
<<243>>,
<<252>>,
<<246>>,
<<1>>,
";",
<<188>>,
"5",
"R",
<<193>>,
"^",
"g",
<<133>>,
<<182>>,
"E",
<<253>>,
"r",
<<26>>,
"d",
"n",
"M",
<<132>>,
"+",
<<215>>,
<<199>>,
<<226>>,
<<165>>,
"J",
<<198>>,
<<240>>,
<<191>>,
<<254>>,
"d",
<<165>>,
"!",
<<219>>,
"*",
<<206>>,
<<246>>,
"i",
"5",
<<174>>,
"$",
<<238>>,
<<211>>,
<<207>>,
"G",
"Α",
...
]
This definitely isn’t correct, or I’m not thinking about something correctly here. Is there something I need to do special for utf8 encoded strings?
Thanks for the help,
Jeramy
Most Liked
jeramyRR
We can close this thread. I got it figured out. There was nothing wrong with the key. There was however a mistake in my spelling.
2
massimo
It’s correct
the decoded string contains those characters
echo "ZG2p8/z2ATu8NVLBXmeFtkX9chpkbk2EK9fH4qVKxvC//mSlIdsqzvZpNa4k7tPPR86RmiGkdi0BLwAEtPbkXA==" | base64 -D -i - | hexdump -c
0000000 d m � � � � 001 ; � 5 R � ^ g 205 �
0000010 E � r 032 d n M 204 + � � � � J � �
0000020 � � d � ! � * � � i 5 � $ � � �
0000030 G � 221 232 ! � v - 001 / \0 004 � � � \
0000040
1
Last Post!
massimo
base64decode.org is simply removing the non printable characters.
try on this one and see the difference https://codebeautify.org/base64-decode
0
Popular in Questions
Hi everyone!
I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
Hello!
Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
In templates/appointment/index.html.eex:
<%= for appointment <- @appointments do %>
<tr>
<td><%= appoi...
New
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
If I have a post route which an argument:
post /my_post_route/:my_param1, MyController.my_post_handler
How would get the post params ...
New
I tried installing
elixir 1.11.2
erlang 23.3.4
via asdf in my zsh shell. Enabled the versions locally and globally.
When I list them ...
New
Other popular topics
Hello, how can I check the Phoenix version ?
Thanks !
New
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
If I have a post route which an argument:
post /my_post_route/:my_param1, MyController.my_post_handler
How would get the post params ...
New
Phoenix 1.4.0 released
Phoenix 1.4 is out! This release ships with exciting new features, most notably
with HTTP2 support, improved deve...
New
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
Hey,
Just curious what are the main benefits of Elixir compared to Clojure?
When is Elixir more useful than Clojure and vice versa?
Th...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security









