简体   繁体   中英

How can I convert sha1 to hash

how can I convert this

11252411445171911438526

to be something like this!

c6ee47d1a8edbce28b1560b836abd388631983b6

anyone help ?

In case you want a SHA1 hash you can do something like this:

String input = "11252411445171911438526";
MessageDigest md = MessageDigest.getInstance("SHA-1");
md.reset();
md.update(input.getBytes("utf8"));
String ouput = new BigInteger(1, md.digest()).toString(16);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM