Inside my code, I generate hashes of URLs (which are of almost unlimited length). I am currently using sha1 (), which I know has a tiny chance of collision, but I have up to 255 bytes to store the hash, so I can use this available space to reduce the likelihood of a collision even later on.
Whether there is a:
Or is sha1 a 20-byte hash good enough for anything, and should I stop worrying about it?
, 20- sha1, -, ?
.
Hashtables, Pigeonholeshttp://www.codinghorror.com/blog/archives/001014.html
... http://www.cryptography.com/cnews/hash.html
: SHA-1?A: 2 ^ 69 ( 590 . .) -
, ... ^ _ ^
, 256- 512- (32 64 ).
, , .
, , md5 sha-256.
/ ( ) ?
, , , a) b) ( - , , / ).
, -, ?
, , , , . :
found = false hv = hash(urlValue) if table[hash,url] contains pair (hv,urlValue) found = true endif if (not found) insert table (hv,urlValue) endif
hash, . (, url) - , , , , URL-. -. , URL- , .
, , URL.
, URL- 40 - 5 : SHA1 1-8, SHA1 9-16, SHA1 17-24... .. 2 800 2 (69 * 5)= 2 345= 7.2 * 10 103 .
, , - . .
Source: https://habr.com/ru/post/1699660/More articles:Eclipse 3.4 ant task freezes - eclipseJavascript onkeypress delete or dot - javascriptDelphi: Removing Visual Component Links from Inherited Forms - delphiHow to start another process in debug mode? - debuggingHow to generate a Websphere MQ script? - message-queueSaving and restoring a queue manager - ibm-mqEnable / Disable Windows Update from vbscript - vbscriptUnit Test to check if an object is free - objective-cJava batch monitoring - javaКак я могу динамически редактировать значения XML node в ActionScript? - flexAll Articles