You haven't explained how big this DB is? I guess that it is possible although VERY unlikely that this DB is small enough to be memory resident.
If we just think about storing just the 20M SHA-1 signatures, each is 20 bytes. For the hardware, powers of 2 are magic and it goes: 2,4,8,16,32. In a practical sense, each signature will take 32 bytes: 8 32 bit(4 byte) words or 16 16 bit(2 byte) words. That is a fair amount of memory for 20M records (like 640MB) and these "keys", (they are SHA-1 signatures) aren't even unique! I don't know what your plan is to deal with that. Oh, of course besides the memory to store the SHA-1 signatures, there has to be some data that points to something (on disk or wherever). That will take some bytes too!
You need a Database. Perl DBI in its many flavors can easily handle 20M records. Forget SHA-1 or SHA-2 that makes no sense. Let the DB use its hash algorithm.
In reply to Re: Question: methods to transfer a long hexadicimal into shorter string
by Marshall
in thread Question: methods to transfer a long hexadicimal into shorter string
by lihao
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |