Long string to short ID
Matthew Evans
mattevans123@REDACTED
Sat Aug 14 01:46:57 CEST 2021
How about:
1> lists:flatten([integer_to_list(V,16)||<<V>> <= crypto:hash(md5, "really long book title that goes on and on forever")]).
"C72BFE8643B0156ACD809D87D51E726C"
OR
2> binary_to_list(base64:encode(crypto:hash(md5, "really long book title that goes on and on forever"))).
"xyv+hkOwFWrNgJ2H1R5ybA=="
________________________________
From: erlang-questions <erlang-questions-bounces@REDACTED> on behalf of Lloyd R. Prentice <lloyd@REDACTED>
Sent: Friday, August 13, 2021 3:44 PM
To: erlang-questions <erlang-questions@REDACTED>
Subject: Long string to short ID
Hello,
What might be a nifty way to turn a long book title with spaces into a short human-readable ID?
Thanks,
LRP
Sent from my iPad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20210813/bf73243e/attachment.htm>
More information about the erlang-questions
mailing list