CRC32 Hashing in Java

Viewed 15189

I am trying to create a crc32 hash of a string in java. I was able to do that with java.util.zip.CRC32. But my requirement is to create the CRC32 hash of a string using a secret key. Can anyone tell me how to do this? Thanks in advance...

My existing code is given below...

String a = "abcdefgh";
CRC32 crc = new CRC32();
crc.update(a.getBytes());

String enc = Long.toHexString(crc.getValue());
System.out.println(enc);
3 Answers
Related