raw hash data to associate array
@param array $hashes
@return array
425637
private function resolveHashes(array $hashes)
    {
        $assoc = [];
        foreach ($hashes as $k => $hash) {
            $item = $this->resolveHash($hash);
            if ($item) {
                $assoc[$k] = $item;
            }
        }

        return $assoc;
    }
1314774
public function getHash($table)
    {
        $fields = array();
        if (isset($table['fields'])) {
            $fields = $table['fields'];
        }
        if (isset($table['field'])) {
            $fields = array($table);
        }
        if (isset($table['keys'])) {
            $fields += $table['keys'];
        }
        $list = array_map(array($this, 'encode_hash'), $fields);
        ksort($list);
        return sha1(strtolower(implode('-', array_keys($list)) . implode('-', $list)));
    }
444265
public function normalizeHeaders(array $headers):array {
		$normalized_headers = [];

		foreach($headers as $key => $val){

			if(is_numeric($key)){
				$header = explode(':', $val, 2);

				if(count($header) === 2){
					$key = $header[0];
					$val = $header[1];
				}
				else{
					continue;
				}
			}

			$key = ucfirst(strtolower($key));

			$normalized_headers[$key] = trim($key).': '.trim($val);
		}

		return $normalized_headers;
	}
106289
protected static function hash($fields)
    {
        foreach ($fields as $key => $value) {
            if (in_array($key, self::$fields)) {
                $fields[$key] = Hash::make($value);
            }
        }

        return $fields;
    }
233439
public function getHash($algo = 'sha1', $raw = false)
    {
        $result = false;

        if ($this->isReadable() && $this->isSeekable())
        {
            $current = $this->peek();
            if ($this->seek(0) && in_array($algo, hash_algos()))
            {
                $hash = hash_init($algo);
                hash_update_stream($hash, $this->_resource);
                $result = hash_final($hash, (bool) $raw);
                $this->seek($current);
            }
        }

        return $result;
    }
628095
public function generateRawHeaders(array $headers)
    {
        $rawHeaders = array();
        foreach ($headers as $key => $values) {
            if (!is_array($values)) {
                $values = array($values);
            }
            foreach ($values as $value) {
                if ($key !== 0) {
                    $rawHeader =  $key . ': ' . $value;
                } else {
                    $rawHeader = $value;
                }
                foreach (explode("\r\n", $rawHeader) as $singleLineRawHeader) {
                    $rawHeaders[] = $singleLineRawHeader;
                }
            }
        }
        return $rawHeaders;
    }
536563
private function loadStepsHash(array $hash)
    {
        $steps = array();
        foreach ($hash as $stepIterator => $stepHash) {
            $steps[] = $this->loadStepHash($stepHash, $stepIterator);
        }

        return $steps;
    }
1153341
protected function getMatchHash()
    {
        $hashes = [];

        foreach($this->matchers as $matcher) {
            $hashes[] = $matcher->getHash();
        }

        return implode('::', $hashes);
    }
451356
public function parseHeaders(array $headers)
    {
        $parsed = [];

        foreach ($headers as $key => $val)
        {
            $parsed[] = $key . ': ' . $val;
        }

        return $parsed;
    }
101928
public function decode($hash): array
    {
        $ret = [];

        if (!\is_string($hash) || !($hash = \trim($hash))) {
            return $ret;
        }

        $alphabet = $this->alphabet;

        $hashBreakdown = \str_replace($this->multiByteSplit($this->guards), ' ', $hash);
        $hashArray = \explode(' ', $hashBreakdown);

        $i = 3 === \count($hashArray) || 2 === \count($hashArray) ? 1 : 0;

        $hashBreakdown = $hashArray[$i];

        if ('' !== $hashBreakdown) {
            $lottery = \mb_substr($hashBreakdown, 0, 1);
            $hashBreakdown = \mb_substr($hashBreakdown, 1);

            $hashBreakdown = \str_replace($this->multiByteSplit($this->seps), ' ', $hashBreakdown);
            $hashArray = \explode(' ', $hashBreakdown);

            foreach ($hashArray as $subHash) {
                $alphabet = $this->shuffle($alphabet, \mb_substr($lottery.$this->salt.$alphabet, 0, \mb_strlen($alphabet)));
                $result = $this->unhash($subHash, $alphabet);
                if ($this->math->greaterThan($result, PHP_INT_MAX)) {
                    $ret[] = $this->math->strval($result);
                } else {
                    $ret[] = $this->math->intval($result);
                }
            }

            if ($this->encode($ret) !== $hash) {
                $ret = [];
            }
        }

        return $ret;
    }
345786
def array_data_to_hash(array_data)
      array_data.each_with_object({}) do |node, memo|
        memo[node['Address'].to_i] = clean_node(node)
      end
    end
765792
private function convertHeaders(array $headers)
    {
        $result = [];
        foreach ($headers as $key => $value) {
            $result[] = $key . ': ' . $value;
        }

        return $result;
    }
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
1064595
protected static function rawData( $object )
    {
        if ( is_object( $object ) )
        {
            $hash = spl_object_hash( $object );

            if ( isset( self::$rawCheck[$hash] ) )
            {
                return array( '#recursion#' => $hash );
            }

            self::$rawCheck[$hash] = true;
        }

        $object = (array) $object;

        foreach ( $object as $key => $value )
        {
            if ( is_array( $value ) || is_object( $value ) )
            {
                $object[$key] = self::rawData( $value );
            }
        }

        return (object) $object;
    }
1183441
public static function convertStringHeadersToArray($headers)
    {
        $lines = explode("\r\n", $headers);
        $headers = [];
        foreach ($lines as $line) {
            if (strpos($line, ':')) {
                $headerParts = explode(':', $line);
                $headers[$headerParts[0]] = trim(implode(':', array_slice($headerParts, 1)));
            }
        }
        return $headers;
    }
192476
private function getBuckets($rawAggregations)
    {
        $buckets = [];

        foreach ($rawAggregations as $bucketName => $rawBucket) {
            while (isset($rawBucket[$bucketName])) {
                $rawBucket = $rawBucket[$bucketName];
            }

            $bucketParams = ['name' => $bucketName, 'values' => $this->getBucketValues($rawBucket)];
            $buckets[$bucketName] = $this->bucketFactory->create($bucketParams);
        }

        return $buckets;
    }
899801
public static function toArray($headers)
    {
        $headers .= "\r\n\r\n";
        preg_match_all('#[\r\n]*([\w-]+\:)(.+?)(?=([\r\n]+[\w-]+\:|[\r\n]{3,}|\n{2,}))#si', $headers, $result);

        $headers = [];
        foreach ($result[1] as $k => $header) {
            $header = strtolower(rtrim($header, ':'));
            $headers[$header][] = trim($result[2][$k]);
        }

        return $headers;
    }