Is there any method to generate MD5 hash of a string in Java?
Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Showing posts with label hashcode. Show all posts
Showing posts with label hashcode. Show all posts
Wednesday, May 30, 2012
Generate MD5 hash in Java
Monday, May 21, 2012
Why is it important to override GetHashCode when Equals method is overriden in C#?
Given the following class
public class Foo
{
public int FooId { get; set; }
public string FooName { get; set; }
public override bool Equals(object obj)
{
Foo fooItem = obj as Foo;
return fooItem.FooId == this.FooId;
}
public override int GetHashCode()
{
// Which is preferred?
return base.GetHashCode();
//return this.FooId.GetHashCode();
}
}
Wednesday, May 9, 2012
What is a sensible prime for hashcode calculation?
Eclipse 3.5 has a very nice feature to generate Java hashCode() functions. It would generate for example (slightly shortened:)
Sunday, March 11, 2012
apache commons equals/hashcode builder
I'm curious to know, what people here think about using org.apache.commons.lang.builder EqualsBuilder/HashCodeBuilder for implementing the equals/hashcode? Would it be a better practice than writing your own? Does it play well with Hibernate? What's your opinion?
Subscribe to:
Posts (Atom)