Gets a hash of the given object in an array order-independent fashion also object key order independent (easier since they can be alphabetized)
351899
function getOrderIndependentHash(object) {
    var accum = 0;
    var type = realTypeOf(object);

    if (type === 'array') {
      object.forEach(function (item) {
        // Addition is commutative so this is order indep
        accum += getOrderIndependentHash(item);
      });

      var arrayString = '[type: array, hash: ' + accum + ']';
      return accum + hashThisString(arrayString);
    }

    if (type === 'object') {
      for (var key in object) {
        if (object.hasOwnProperty(key)) {
          var keyValueString = '[ type: object, key: ' + key + ', value hash: ' + getOrderIndependentHash(object[key]) + ']';
          accum += hashThisString(keyValueString);
        }
      }

      return accum;
    }

    // Non object, non array...should be good?
    var stringToHash = '[ type: ' + type + ' ; value: ' + object + ']';
    return accum + hashThisString(stringToHash);
  }
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
685268
def convert object
      return {resource_name => object} if object.is_a? Hash
      {resource_name =>  object.to_hash}
    end
814683
def to_hash
      @relations.each_with_object({}) do |(rel,val), obj|
        rel = rel.to_s

        hashed_val = val.map(&:to_hash)
        if val.length == 1 && !single_item_arrays?
          hashed_val = val.first.to_hash
        end

        obj[rel] = hashed_val
      end
    end
247316
def graph_hash(obj):
    ''''''
    obj_type = type(obj)
    try:
        # this works for hashables
        return hash((obj_type, obj))
    except:
        # this works for object containers since graphdb
        # wants to identify different containers
        # instead of the sum of their current internals
        return hash((obj_type, id(obj)))
578937
function hash(object) {
  return crypto
    .createHash('sha256')
    .update(typeof object === 'string' ? object : JSON.stringify(object))
    .digest('base64')
}
1190274
def to_hash
      ret = {}
      self.each_pair do |k, v|
        ret[k] = v.to_hash()
      end
      ret
    end
1129591
def to_hash(obj=nil, methods:[], recursive: false, check: false, compact: false)
			return {} if obj.nil?
			obj||=self
			stack=[*obj]
			processed=[]
			klass=stack.first.class
			h={}
			while !stack.empty?
				obj=stack.shift
				next if processed.include?(obj)
				processed << obj
				attributes={}
				methods.each do |m|
					next if check and !obj.respond_to? m
					v=obj.public_send(m)
					attributes[m]=v
					if recursive
						vals=v.kind_of?(Enumerable) ? v.to_a.flatten : [v]
						vals.select! {|v| v.kind_of?(klass)}
						stack.concat(vals)
					end
				end
				attributes=attributes.values.first if compact and attributes.keys.length == 1
				h[obj]=attributes
			end
			h
		end
142102
def to_hash
      hash = {}
      each_pair do |key, value|
        if value.kind_of?(ConfigHash)
          value = value.to_hash
        end
        
        hash[key] = value
      end
      hash
    end
1152479
function keys(obj) {
    var keyArray = [];
    var key;

    for (key in obj) {
        if (obj.hasOwnProperty(key)) {
            keyArray.push(key);
        }
    }

    return keyArray;
}
1304560
function hashHas(key) {
    var data = this.__data__;
    return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  }
1103106
def stringify_keys(object)
      case object
      when Hash
        object.each_with_object({}) do |(key, value), result|
          result[key.to_s] = stringify_keys(value)
        end
      when Array
        object.map { |e| stringify_keys(e) }
      else
        object
      end
    end
141348
def to_hash
      out = {}
      self.class.properties.each { |p| out[hash_key(p)] = hash_value(p) }
      out
    end
865773
def hash_from(sym)
      starting_sym = key_as_sym(sym)
      bundle = ((starting_sym == container) ? container : { starting_sym => container[starting_sym] })
      bundle.keys.each_with_object({}) do |attr,collector|
        value = bundle[attr]
        case value
          when NestedResult, self.class
            value = value.to_hash
          when Array
            value = value.map {|ele| array_to_hash(ele) }
        end
        collector[attr] = value                                                          # new copy
      end
    end
254382
function objectHash(obj) {
	var hash = crypto.createHash('md5');
	hash.update(makeHashKey(obj));
	return hash.digest('hex');
}
471960
function sortKeys(obj)
{
  var sortedObj = {};

  if (typeOf(obj) == 'object')
  {
    Object.keys(obj).sort().forEach(function(key)
    {
      sortedObj[key] = sortKeys(obj[key]);
    });

    obj = sortedObj;
  }

  return obj;
}
1105794
function sortKeys(obj) {
  return Object.keys(obj).sort().reduce(function (r, k) {
    r[k] = obj[k];

    return r[k], r;
  }, {});
}