Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
803 views
in Technique[技术] by (71.8m points)

how to generate a hash of Alder32 (8 characters) in Java

When i check the alder32 on online website https://md5calc.com/hash/adler32/ I get the result a string of 8 characters

     alder32('hello')  ==> 062c0215

but when I search for the implementation I just found the checksum number

 Checksum checksum = new Adler32();
 checksum.update(bytes,0,bytes.length);
 long lngChecksum = checksum.getValue();
 System.out.println("Adler32 checksum for byte array is :" + lngChecksum);
/*
Output of this program would be
Adler32 checksum for byte array is :2593132786
*/

The result is a number ,how can i get the string result with 8 characters. Thanks

question from:https://stackoverflow.com/questions/66061274/how-to-generate-a-hash-of-alder32-8-characters-in-java

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...