Created
May 18, 2014 23:33
-
-
Save dch/bb33330a6d68b8149103 to your computer and use it in GitHub Desktop.
erlang quick conversion of binary sha hash to printable hex/ascii
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(akai@akai)27> Hex=fun(<<Hash:20/big-unsigned-integer-unit:8>>) -> | |
lists:flatten(io_lib:format("~40.16.0b", [Hash])) end. | |
#Fun<erl_eval.6.106461118> | |
(akai@akai)28> Hex(<<200,152,0,191,200,46,208,30,214,227,191,213,64,140,81,39,68,145,247,212>>). | |
"c89800bfc82ed01ed6e3bfd5408c51274491f7d4" | |
(akai@akai)29> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you so much! Saving these here, in case someone else wants to decipher it quickly:
Format
options)(from this SO answer)