/[classpath]/classpath/gnu/java/security/der/BitString.java
ViewVC logotype

Diff of /classpath/gnu/java/security/der/BitString.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by mark, Sat Jul 2 20:32:14 2005 UTC revision 1.4 by tromey, Sat Oct 1 18:48:45 2005 UTC
# Line 286  public class BitString implements Clonea Line 286  public class BitString implements Clonea
286      return 0; // not reached.      return 0; // not reached.
287    }    }
288    
289      public int hashCode()
290      {
291        int result = 0;
292        for (int i = 0; i < bytes.length - 1; ++i)
293          result = result * 31 + bytes[i];
294        if (bytes.length > 0)
295          {
296            int lastByte = bytes[bytes.length - 1] & ~ ((1 << ignoredBits) - 1);
297            result = result * 31 + lastByte;
298          }
299        return result;
300      }
301    
302    public boolean equals(Object o)    public boolean equals(Object o)
303    {    {
304      if (!(o instanceof BitString))      if (!(o instanceof BitString))

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26