• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About Adler 32 checksum

 
madura shantha
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...
Can we use adler32 to compare two strings?
I have a hashmap with a String as it's value field and the key is adler32 checksum of that string.I want to check whether this hashmap contains another string.I get the checksum of that and compare it with keys in hash map.is it correct?
 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi madura,

welcome to the ranch Please take a look at the JavaRanch naming policy first and correct your display name accordingly!

For your question: If I understood you correctly, you just want to look if the checksum you have for a string is already as a key in the HashMap?!? That's even easier! Just use method containsKey() of your HashMap. It returns whether the key in question is in the HashMap or not.

Marco
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic