Creation of object hash when sending request to soap
771377
def to_hash
      hash = {}
      hash["attrs"] = @attrs

      self.instance_variables.keep_if { |key| key != :@attrs }.each do |var|
        val = self.instance_variable_get(var)
        hash["attrs"][var.to_s.delete("@").to_sym] = val.to_hash if val.is_a? ACTV::Base
      end

      hash["attrs"]
    end
657701
def security_hash(namespace, tag, hash, extra_info = {})
      key = [namespace, tag].compact.join(":")

      sec_hash = {
        "wsse:Security" => {
          key => hash
        },
        :attributes! => { "wsse:Security" => { "xmlns:wsse" => WSE_NAMESPACE } }
      }

      unless extra_info.empty?
        sec_hash["wsse:Security"].merge!(extra_info)
      end

      if signature?
        sec_hash[:attributes!].merge!("soapenv:mustUnderstand" => "1")
      else
        sec_hash["wsse:Security"].merge!(:attributes! => { key => { "wsu:Id" => "#{tag}-#{count}", "xmlns:wsu" => WSU_NAMESPACE } })
      end

      sec_hash
    end
1371964
def to_h
      sanitized_params.each_with_object({}) do |(key, value), hash|
        hash[key] = transform(key, value)
      end
    end
1185670
function hash(object) {
    if (object === undefined || isScalar(object)) {
        return '' + object;
    }

    if (object.hash) {
        return object.hash();
    }

    //Default implementation
    var hashes = [],
        value, key, hashKey, hashValue;

    for (key in object) {
        if (object.hasOwnProperty(key)) {
            value = object[key];
            hashKey = String(key);
            hashValue = hash(value);
            hashValue = (hashKey > hashValue) ? hashValue + hashKey : hashKey + hashValue;
            hashes.push(hashValue);
        }
    }

    return hashes.sort().join('');
}
319442
def construct_request_hash
      request = {
        url: url,
        component: component,
        action: action,
        params: params,
        session: session,
        cgi_data: cgi_data,
        sanitizer: request_sanitizer
      }
      request.delete_if {|k,v| config.excluded_request_keys.include?(k) }
      Util::RequestPayload.build(request)
    end
437315
function hash_serializer(result, key, value) {
  var matches = key.match(brackets);

  // Has brackets? Use the recursive assignment function to walk the keys,
  // construct any missing objects in the result tree and make the assignment
  // at the end of the chain.
  if (matches) {
    var keys = parse_keys(key);
    hash_assign(result, keys, value);
  }
  else {
    // Non bracket notation can make assignments directly.
    var existing = result[key];

    // If the value has been assigned already (for instance when a radio and
    // a checkbox have the same name attribute) convert the previous value
    // into an array before pushing into it.
    //
    // NOTE: If this requirement were removed all hash creation and
    // assignment could go through `hash_assign`.
    if (existing) {
      if (!Array.isArray(existing)) {
        result[key] = [ existing ];
      }

      result[key].push(value);
    }
    else {
      result[key] = value;
    }
  }

  return result;
}
655054
def to_hash
            index_hash = Hash.new
            index_hash["json_claz"] = self.class.name
            index_hash["id"] = id
            index_hash["account_id"] = account_id
            index_hash["asm_id"] = asm_id
            index_hash["org_id"] = org_id
            index_hash["disk_id"] = disk_id
            index_hash["size"] = size
            index_hash["status"] = status
            index_hash["created_at"] = created_at
            index_hash["some_msg"] = some_msg
            index_hash
        end
254382
function objectHash(obj) {
	var hash = crypto.createHash('md5');
	hash.update(makeHashKey(obj));
	return hash.digest('hex');
}
1175368
private String makeHash(String request) throws CacheException {
        RequestCtx reqCtx = null;
        try {
            reqCtx = m_contextUtil.makeRequestCtx(request);
        } catch (MelcoeXacmlException pe) {
            throw new CacheException("Error converting request", pe);
        }
        byte[] hash = null;
        // ensure thread safety, don't want concurrent invocations of this method all modifying digest at once
        // (alternative is to construct a new digest for each(
        synchronized(digest) {
            digest.reset();

            hashSubjectList(reqCtx.getSubjectsAsList(), digest);

            hashAttributeList(reqCtx.getResourceAsList(), digest);

            hashAttributeList(reqCtx.getActionAsList(), digest);

            hashAttributeList(reqCtx.getEnvironmentAttributesAsList(), digest);

            hash = digest.digest();
        }

        return byte2hex(hash);
    }
512569
def marshal_dump
      h = to_h
      if h[:attributes]
        h[:attributes] = h[:attributes].clone
        h[:attributes].instance_variable_set(:@client, nil)
      end

      if h[:original_object]
        h[:original_object] = h[:original_object].clone
        h[:original_object].instance_variable_set(:@client, nil)

        if h[:original_object]['attributes']
          h[:original_object]['attributes'] = h[:original_object]['attributes'].clone
          h[:original_object]['attributes'].instance_variable_set(:@client, nil)
        end
      end
      h
    end
968602
def to_hash
      result = { }

      # id
      result['_id'] = @_id if @_id

      # timestamp
      result['at'] = @at

      # kind
      result['kind'] = kind.to_s

      # entities
      @entities.each do |entity_name, entity|
        result[entity_name.to_s] = entity.model_id
      end

      # meta
      result['meta'] = @meta.stringify_keys unless @meta.blank?

      result
    end
1231331
def to_hash
      stringified_params = Hash[parameters.map { |key, val| [key.to_s, val] }]
      base_hash.merge(stringified_params)
    end
310667
def convert_to_hash(object)
      if !object.respond_to?(:to_hash)
        return nil
      end

      if object.method(:to_hash).arity != 0
        return nil
      end

      hash = object.to_hash
      if !hash.respond_to?(:keys) || !hash.respond_to?('[]')
        return nil
      end

      return hash
    end
770405
def to_hash
      index_hash = Hash.new
      index_hash["json_claz"] = self.class.name
      index_hash["id"] = id
      index_hash["name"] = name
      index_hash["accounts_id"] = accounts_id
      index_hash["related_orgs"] = related_orgs
      index_hash["created_at"] = created_at
      index_hash
    end
1166627
def create_hash(response)
      begin
        JSON.parse response
      rescue JSON::ParserError
        response
      rescue StandardError
        response
      end
    end
1060822
def params_array(object)
      case object
      when Array then object
      when Hash then object.to_a
      when RequestProxy
        tmp = object.path.split('?')
        params = tmp[1] ? params_decode(tmp[1]) : []
        if object.post? && object.headers['Content-Type'].to_s.start_with?('application/x-www-form-urlencoded')
          params.concat params_decode(object.body)
        end
        params
      else
        raise "error: cannot convert #{object.class} object to params array"
      end
    end
1025995
function (request) {

        let serialized = request.serialized;
        serialized.application = beyond.params.name;
        serialized = JSON.stringify(serialized);

        let hash = serialized.split('').reduce(function (a, b) {
            a = ((a << 5) - a) + b.charCodeAt(0);
            return Math.abs(a & a);
        }, 0);

        hash = 'RPC:' + hash;

        return hash;

    }