summaryrefslogtreecommitdiff
path: root/hv_func.h
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2013-07-26 22:01:00 -0400
committerTony Cook <tony@develop-help.com>2013-07-29 13:30:33 +1000
commitfab3d10781b2a5e8067e1e72de1f16af573fe356 (patch)
tree5e5dd902ac7d41069701fee4c46d7dc9b4a4928e /hv_func.h
parent5c24ac0b0c104d20c33f36ee47a3ab87844d7f7f (diff)
downloadperl-fab3d10781b2a5e8067e1e72de1f16af573fe356.tar.gz
comments only, explain the different ONE_AT_A_TIME algos
Seeing 3 hash algos with the same name is confusing. If they are the same name ("one at a time"), then why are there 3 different ones? What are the differences (without reading the code)? What are the pros and cons of each? INSTALL lists the ONE_AT_A_TIME algos as existing, but doesn't explain why there are 3 of them. Patch with jkeenan suggestions.
Diffstat (limited to 'hv_func.h')
-rw-r--r--hv_func.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/hv_func.h b/hv_func.h
index 7678807d88..b2bde906e2 100644
--- a/hv_func.h
+++ b/hv_func.h
@@ -472,6 +472,16 @@ S_perl_hash_sdbm(const unsigned char * const seed, const unsigned char *str, con
return hash;
}
+/* - ONE_AT_A_TIME_HARD is the 5.17+ recommend ONE_AT_A_TIME algorithm
+ * - ONE_AT_A_TIME_OLD is the unmodified 5.16 and older algorithm
+ * - ONE_AT_A_TIME is a 5.17+ tweak of ONE_AT_A_TIME_OLD to
+ * prevent strings of only \0 but different lengths from colliding
+ *
+ * Security-wise, from best to worst,
+ * ONE_AT_A_TIME_HARD > ONE_AT_A_TIME > ONE_AT_A_TIME_OLD
+ * There is a big drop-off in security between ONE_AT_A_TIME_HARD and
+ * ONE_AT_A_TIME
+ * */
/* This is the "One-at-a-Time" algorithm by Bob Jenkins
* from requirements by Colin Plumb.