       default: () // Ignore.
     }
 
-    hash ^= UInt32(len)
+    hash ^= UInt32(maxBytes)
 
     hash ^= hash >> 16
     hash = hash &* 0x85ebca6b

    k = 0

    // remainder
    switch len & 3 { // `len % 4'
      case 3: k ^= UInt32(tail[2] << 16)
      case 2: k ^= UInt32(tail[1] << 8)
      case 1:

    return hash
  }

  public static func hash32(key: String, seed: UInt32 = 0) -> UInt32 {
    var a = [UInt8](key.utf8)
    return doHash32(&a, maxBytes: a.count, seed: seed)
  }

  public static func hash32CChar(key: [CChar], maxBytes: Int,
      seed: UInt32 = 0) -> UInt32 {
    let ap = UnsafePointer<UInt8>(key)
    return doHash32(ap, maxBytes: maxBytes, seed: seed)
  }

  public static func hash32Bytes(key: [UInt8], maxBytes: Int,
      seed: UInt32 = 0) -> UInt32 {
    var a = key
    return doHash32(&a, maxBytes: maxBytes, seed: seed)
  }

}
