public function getHash($object)
    {
        // Bail out if a non-object was passed.
        if (!is_object($object)) {
            throw Object_Freezer_Util::getInvalidArgumentException(1, 'object');
        }

        $attributes = Object_Freezer_Util::readAttributes($object);
        ksort($attributes);

        if (isset($attributes['__php_object_freezer_hash'])) {
            unset($attributes['__php_object_freezer_hash']);
        }

        foreach ($attributes as $key => $value) {
            if (is_array($value)) {
                $attributes[$key] = '<array>';
            } elseif (is_object($value)) {
                if (!isset($value->__php_object_freezer_uuid)) {
                    $value->__php_object_freezer_uuid =
                    $this->idGenerator->getId();
                }

                $attributes[$key] = $value->__php_object_freezer_uuid;
            } elseif (is_resource($value)) {
                $attributes[$key] = null;
            }
        }

        return sha1(get_class($object).implode(':', $attributes));
    }