groovy - Most efficient way to store big hexadecimal number (md5) in java object -
what efficient way (optimal performance , storage space) store md5
sum of file in java (or groovy) object considering following use-cases:
- i need compare thousands of other md5 sums.
- i may need store in hsqldb, records can pulled/
group by
based on md5 - may stored in
map
's keys
i trying avoid storing string
string comparisons more costly , take more space. biginteger(string,radix)
more efficient? also, datatype should selected if persisting in database?
create class wraps byte[]
, provides no mutation. if want use key in map, needs either comparable, or have hash code. byte[]
you'll have easier time computing simple hashcode first 32 bits.
Comments
Post a Comment