Generate a hash range expression.
@return  hash range expression
15775
public HashRangeExpression build(Integer hashColumnIndex) {
        Map<Integer, Integer> ranges = m_builder.build();
        HashRangeExpression predicate = new HashRangeExpression();
        predicate.setRanges(ranges);
        predicate.setHashColumnIndex(hashColumnIndex);
        return predicate;
    }
176817
public static RubyRange<String> range(String start, String end) {
    return new RubyRange<>(StringSuccessor.getInstance(), start, end,
        Interval.CLOSED);
  }
965242
public static long generate(long hash, 
                              long value)
  {
    final long m = 0xc6a4a7935bd1e995L;
    final int r = 47;
    
    int length = 8;
    
    hash ^= length * m;

    long k = Long.reverseBytes(value);
      
    k *= m;
    k ^= k >>> r;
    k *= m;
    hash ^= k;
    hash *= m;
    
    hash ^= hash >>> r;
    hash *= m;
    hash ^= hash >>> r;
    
    return hash;
  }
937881
public function getValue(): ?Range
	{
		if (!empty($this->value)) {
			$result = new Range;
			@list($from, $to) = explode($this->delimiter, $this->value);

			if ($from && $to) {
				$result->from = DateTime::createFromFormat($this->format, $from);
				$result->to = DateTime::createFromFormat($this->format, $to);
				return $result;
			}
		}
		return null;
	}
649519
public INDArray getRange() {
        if (range == null) {
            try (MemoryWorkspace ws = Nd4j.getMemoryManager().scopeOutOfWorkspaces()) {
                range = upper.sub(lower);
            }
        }
        return range;
    }
1329867
public function range()
    {
        $start = $this->page - $this->range;
        $start = ($start < 1) ? 1 : $start;
        $end   = $this->page + $this->range;
        $end   = ($end > $this->pageTotal) ? $this->pageTotal : $end;

        $this->ranges = [
            'start'   => $start,
            'end'     => $end
        ];

        return $this->ranges;
    }
519594
def hash_to_range(element)
      hash = SipHash.digest(key, element)
      map_into_range(hash, f)
    end
471531
public static RubyRange<Double> range(double start, double end) {
    String startStr = String.valueOf(start);
    String endStr = String.valueOf(end);
    int startPrecision = startStr.length() - startStr.lastIndexOf('.') - 1;
    int endPrecision = endStr.length() - endStr.lastIndexOf('.') - 1;
    return new RubyRange<>(
        new DoubleSuccessor(Math.max(startPrecision, endPrecision)), start, end,
        Interval.CLOSED);
  }
851355
public function getHash()
    {
        $hashes = array();

        foreach ($this->getPatches() as $patch) {
            $hashes[] = $patch->getHash();
        }
        sort($hashes);

        return sha1(implode(' ', $hashes));
    }
1340781
public static int hash(int hashCode, int level) {
		final int rotation = level * 11;
		int code = Integer.rotateLeft(hashCode, rotation);
		return code >= 0 ? code : -(code + 1);
	}
680636
public int[] get() {
        int includedHashes = Math.min(m_hashCount, MAX_HASHES_COUNT);
        int[] retval = new int[includedHashes + HEADER_OFFSET];
        System.arraycopy(m_hashes, 0, retval, HEADER_OFFSET, includedHashes);

        m_inputCRC.update(m_hashCount);
        m_inputCRC.update(m_catalogVersion);
        retval[0] = (int) m_inputCRC.getValue();
        retval[1] = m_catalogVersion;
        retval[2] = m_hashCount;
        return retval;
    }
1364967
public function getHash(): ?string
    {
        if (!$this->_hash) {
            $this->_hash = $this->generateHash();
        }

        return $this->_hash;
    }
416873
public function getHash()
    {
        $hash = array();

        // expression
        $hash[] = json_encode($this->expression->toArray());

        // sorts
        if (!empty($this->sort)) {
            $sort = $this->sort;
            ksort($sort);
            $hash[] = implode('', array_merge(array_keys($sort), array_values($sort)));
        }

        // fields
        if (!empty($this->projection)) {
            $fields = $this->projection;
            ksort($fields);
            $hash[] = implode('', array_merge(array_keys($fields), array_values($fields)));
        }

        // skip and limit
        $hash[] = $this->skip;
        $hash[] = $this->limit;

        // get hash
        return md5(implode(':', $hash));
    }
106934
public Iterator<RangeTombstone> rangeIterator()
    {
        return ranges == null ? Iterators.<RangeTombstone>emptyIterator() : ranges.iterator();
    }
35749
public function range($range = null)
    {
        if (!func_num_args()) {
            return $this->_start . '-' . ($this->_limit ? $this->_start + $this->_limit : '');
        }
        $values = explode('-', $range);
        $this->_start = (int) $values[0];
        $this->_limit = $values[1] !== '' ? $values[1] - $values[0] : null;
        return $this;
    }
1080687
private String generateHash(String secret) {

		//check for any null values and set them to empty string for hashing
		String timeStamp = null == this.timeStamp ? "" : this.timeStamp;
		String merchantId = null == this.merchantId ? "" : this.merchantId;
		String orderId = null == this.orderId ? "" : this.orderId;
		String result = null == this.result ? "" : this.result;
		String message = null == this.message ? "" : this.message;
		String pasRef = null == this.pasRef ? "" : this.pasRef;
		String authCode = null == this.authCode ? "" : this.authCode;

		//create String to hash
		String toHash = new StringBuilder().append(timeStamp)
				.append(".")
				.append(merchantId)
				.append(".")
				.append(orderId)
				.append(".")
				.append(result)
				.append(".")
				.append(message)
				.append(".")
				.append(pasRef)
				.append(".")
				.append(authCode)
				.toString();

		return GenerationUtils.generateHash(toHash, secret);
	}
941149
protected function define_ranges() {

        $nparts = $this->get_number_parts();

        $rangeduration = ($this->analysable->get_end() - $this->analysable->get_start()) / $nparts;

        $ranges = array();
        for ($i = 0; $i < $nparts; $i++) {
            $end = $this->analysable->get_start() + intval($rangeduration * ($i + 1));
            if ($i === ($nparts - 1)) {
                // Better to use the end for the last one as we are using floor above.
                $end = $this->analysable->get_end();
            }
            $ranges[$i] = array(
                'start' => $this->analysable->get_start(),
                'end' => $end,
                'time' => $end
            );
        }

        return $ranges;
    }