Changeset 13720
- Timestamp:
- 01/05/12 21:56:44 (12 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/ComplexString.java
r13412 r13720 518 518 public int sxhash() 519 519 { 520 int hashCode = 0;520 int hashCode = randomStringHashBase; 521 521 final int limit = length(); 522 522 for (int i = 0; i < limit; i++) … … 536 536 public int psxhash() 537 537 { 538 int hashCode = 0;538 int hashCode = randomStringHashBase; 539 539 final int limit = length(); 540 540 for (int i = 0; i < limit; i++) -
trunk/abcl/src/org/armedbear/lisp/Lisp.java
r13695 r13720 142 142 public static final LispObject EOF = new LispObject(); 143 143 144 // String hash randomization base 145 // Sets a base offset hashing value per JVM session, as an antidote to 146 // http://www.nruns.com/_downloads/advisory28122011.pdf 147 // (Denial of Service through hash table multi-collisions) 148 public static final int randomStringHashBase = 149 (int)(new java.util.Date().getTime()); 150 144 151 public static boolean profiling; 145 152 -
trunk/abcl/src/org/armedbear/lisp/SimpleString.java
r12958 r13720 417 417 public int sxhash() 418 418 { 419 int hashCode = 0;419 int hashCode = randomStringHashBase; 420 420 for (int i = 0; i < capacity; i++) { 421 421 hashCode += chars[i]; … … 427 427 hashCode += (hashCode << 15); 428 428 return (hashCode & 0x7fffffff); 429 }429 } 430 430 431 431 // For EQUALP hash tables. … … 433 433 public int psxhash() 434 434 { 435 int hashCode = 0;435 int hashCode = randomStringHashBase; 436 436 for (int i = 0; i < capacity; i++) { 437 437 hashCode += Character.toUpperCase(chars[i]);
Note: See TracChangeset
for help on using the changeset viewer.