public function generateHash($object)
    {
        if (!is_object($object)) {
            throw new InvalidArgumentException(1, 'object');
        }

        $properties = call_user_func($this->propertyReader, $object);
        ksort($properties);

        if (isset($properties['__freezer'])) {
            unset($properties['__freezer']);
        }

        foreach ($properties as $name => $value) {
            if (is_array($value)) {
                $properties[$name] = '<array>';
            } elseif (is_object($value)) {
                if (!isset($value->{$this->idProperty})) {
                    $value->{$this->idProperty} = $this->generateId();
                }

                $properties[$name] = (string)$value->{$this->idProperty};
            } elseif (is_resource($value)) {
                $properties[$name] = null;
            }
        }

        return sha1(get_class($object) . join(':', $properties));
    }