Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news.stack.nl!.POSTED!not-for-mail From: Willem Newsgroups: comp.lang.java.programmer,comp.programming,comp.lang.java.databases Subject: Re: Storing large strings for future equality checks Date: Wed, 8 Jun 2011 17:28:44 +0000 (UTC) Organization: Stack Usenet News Service Lines: 23 Message-ID: References: NNTP-Posting-Host: toad.stack.nl Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: mud.stack.nl 1307554124 55911 2001:610:1108:5010::135 (8 Jun 2011 17:28:44 GMT) X-Complaints-To: abuse@stack.nl NNTP-Posting-Date: Wed, 8 Jun 2011 17:28:44 +0000 (UTC) User-Agent: slrn/0.9.9p1 (FreeBSD) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5118 comp.programming:439 comp.lang.java.databases:461 markspace wrote: ) On 6/8/2011 9:35 AM, Abu Yahya wrote: )> I considered using an SHA-512 hash of these strings and storing them in )> the database. However, while these will save on storage space, it will )> take time to do the hashing before comparing an incoming string. So I'm )> still wasting time. (Collisions due to hashing will not be a problem, )> since an occasional false positive will not be fatal for my application). ) ) You have to store the whole string. Even if the SHA-512 hash codes are ) equal, it could be that the strings are different. You'll have to ) eventually compare the raw string, even if the SHA is used as a ) quick-out case. No he doesn't. Read again. Especially the last bit between parentheses. SaSW, Willem -- Disclaimer: I am in no way responsible for any of the statements made in the above text. For all I know I might be drugged or something.. No I'm not paranoid. You all think I'm paranoid, don't you ! #EOT