Untitled notebook
Mix.install([
{:hexdump, "~> 0.1.4"}
])
Section
defmodule B64ToFloat do
def to_float(b64) do
b64
|> Base.decode64!()
|> decode_signed()
|> Kernel./(100)
end
defp decode_signed(binary) do
size = bit_size(binary)
<> = binary
value
end
end
# 0, 855, -15,
Enum.map(["+iQ=", "AA==", "AU38", "+iQ="], &B64ToFloat.to_float/1) |> Enum.join("\n") |> IO.puts()