diff --git a/lib/qrb/attribute.rb b/lib/qrb/attribute.rb
index <HASH>..<HASH> 100644
--- a/lib/qrb/attribute.rb
+++ b/lib/qrb/attribute.rb
@@ -1,4 +1,10 @@
 module Qrb
+  #
+  # Helper class for tuple and relation attributes.
+  #
+  # An attribute is simply a `(name: AttrName, type: Type)` pair, where the
+  # type is a Q type.
+  #
   class Attribute
 
     def initialize(name, type)
@@ -14,6 +20,12 @@ module Qrb
     end
     attr_reader :name, :type
 
+    # Fetch the attribute on `arg`, which is expected to be a Hash object.
+    #
+    # This method allows working with ruby hashes having either Symbols or
+    # Strings as keys. It ensures that no Symbol is created by the rest of the
+    # code, since this would provide a DoS attack verctor under MRI.
+    #
     def fetch_on(arg, &bl)
       unless arg.respond_to?(:fetch)
         raise ArgumentError, "Object responding to `fetch` expected"
@@ -34,7 +46,7 @@ module Qrb
     alias :eql? :==
 
     def hash
-      name.hash + 37*type.hash
+      name.hash ^ type.hash
     end
 
   end # class Attribute
Document Attribute and change hash strategy.