Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple hash function (1 byte output from string input)

I'm looking for a simple hash algroithm that will give me one byte of output for a string input (the inputs will be RFC822 email addresses, if that helps).

I'd like it to be simple, fast, and to magnify input differences (so two similar addresses have differnt outputs). (Yes, I am asking for a lot in one byte of output.)

Idealy, I'd like an XSL answer, but I can take it in either Java or Javascript (and then pass the hash as an argument to the XSL processor).

Thanks.

like image 917
Moose Morals Avatar asked Sep 11 '26 04:09

Moose Morals


1 Answers

Why not take the most/least significant byte of the standard String hashCode() function ?

like image 198
Brian Agnew Avatar answered Sep 12 '26 17:09

Brian Agnew



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!