Erlang returns me a different result than the bash command when I "sha256".
echo a | sha256sum, returns: 87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7 -
Erlang
Bin = crypto:hash(sha256, "a").
<<202,151,129,18,202,27,189,202,250,194,49,179,154,35,220,
77,167,134,239,248,20,124,78,114,185,128,119,133,175,
238,72,187>>
I tried different bin to hex from bin to hex None of them gave the result I was expecting.
I got this as a result:
bin_to_hex:bin_to_hex(Bin).
<<"CA978112CA1BBDCAFAC231B39A23DC4DA786EFF8147C4E72B9807785AFEE48BB">>