Ensures all values of the given `hash` are BINARY-encoded, if necessary.
9621
def binary_encode_any_high_ascii_in_hash(hash)
      Hash[hash.map { |key, value| [key, binary_encode_any_high_ascii(value)] }]
    end
997663
private int _hashCode(Object values) {
        int valueHash = 0;
        if (values instanceof Object[])
            valueHash = Arrays.deepHashCode((Object[]) values);
        else if (values instanceof byte[])
            valueHash = Arrays.hashCode((byte[]) values);
        else if (values instanceof short[])
            valueHash = Arrays.hashCode((short[]) values);
        else if (values instanceof int[])
            valueHash = Arrays.hashCode((int[]) values);
        else if (values instanceof long[])
            valueHash = Arrays.hashCode((long[]) values);
        else if (values instanceof char[])
            valueHash = Arrays.hashCode((char[]) values);
        else if (values instanceof float[])
            valueHash = Arrays.hashCode((float[]) values);
        else if (values instanceof double[])
            valueHash = Arrays.hashCode((double[]) values);
        else if (values instanceof boolean[])
            valueHash = Arrays.hashCode((boolean[]) values);
        else if (values != null)
            valueHash = values.hashCode();
        return valueHash;
    }
1109568
def _bit_is_one(self, n, hash_bytes):
        

        scale = 16  # hexadecimal

        if not hash_bytes[int(n / (scale / 2))] >> int(
                (scale / 2) - ((n % (scale / 2)) + 1)) & 1 == 1:
            return False
        return True
1209802
def _ensure_length(encoded, min_length, alphabet, guards, values_hash):
    """"""
    len_guards = len(guards)
    guard_index = (values_hash + ord(encoded[0])) % len_guards
    encoded = guards[guard_index] + encoded

    if len(encoded) < min_length:
        guard_index = (values_hash + ord(encoded[2])) % len_guards
        encoded += guards[guard_index]

    split_at = len(alphabet) // 2
    while len(encoded) < min_length:
        alphabet = _reorder(alphabet, alphabet)
        encoded = alphabet[split_at:] + encoded + alphabet[:split_at]
        excess = len(encoded) - min_length
        if excess > 0:
            from_index = excess // 2
            encoded = encoded[from_index:from_index+min_length]

    return encoded
298591
def hash_from_target(target)
      bytes = []
      while target > 0
        bytes << (target % 256)
        target /= 256
      end
      BTC::Data.data_from_bytes(bytes).ljust(32, "\x00".b)
    end
613104
def is_hash(fhash):
    """"""

    # Intentionally doing if/else statement for ease of testing and reading
    if re.match(re_md5, fhash):
        return True
    elif re.match(re_sha1, fhash):
        return True
    elif re.match(re_sha256, fhash):
        return True
    elif re.match(re_sha512, fhash):
        return True
    elif re.match(re_ssdeep, fhash):
        return True
    else:
        return False
509546
def normalize_hash(hash)
      new_hash = {}

      hash.each do |key,value|
        new_hash[key.to_sym] = normalize(value)
      end

      return new_hash
    end
207564
private static int hashCodeAsciiCompute(CharSequence value, int offset, int hash) {
        if (BIG_ENDIAN_NATIVE_ORDER) {
            return hash * HASH_CODE_C1 +
                    // Low order int
                    hashCodeAsciiSanitizeInt(value, offset + 4) * HASH_CODE_C2 +
                    // High order int
                    hashCodeAsciiSanitizeInt(value, offset);
        }
        return hash * HASH_CODE_C1 +
                // Low order int
                hashCodeAsciiSanitizeInt(value, offset) * HASH_CODE_C2 +
                // High order int
                hashCodeAsciiSanitizeInt(value, offset + 4);
    }
861949
private int hashinateBytes(Object obj) {
        byte[] bytes = VoltType.valueToBytes(obj);
        if (bytes == null) {
            return 0;
        }

        ByteBuffer buf = ByteBuffer.wrap(bytes);
        final int hash = MurmurHash3.hash3_x64_128(buf, 0, bytes.length, 0);
        long token = getTokenPtr(hash);
        return Bits.unsafe.getInt(token + 4);
    }
250353
def hash_value(key)
      if :hash == self.type
        value_node = self.children.find { |pair_node| pair_node.key.to_value == key }
        value_node ? value_node.value : nil
      else
        raise Synvert::Core::MethodNotSupported.new "has_key? is not handled for #{self.debug_info}"
      end
    end
862536
def match_internal?(hashes, size)
      n, payload = Bitcoin.unpack_var_int(encoded.htb)
      bit_reader = Bitcoin::BitStreamReader.new(payload)
      value = 0
      hashes_index = 0
      n.times do
        delta = golomb_rice_decode(bit_reader, p)
        value += delta
        loop do
          return false if hashes_index == size
          return true if hashes[hashes_index] == value
          break if hashes[hashes_index] > value
          hashes_index += 1
        end
      end
      false
    end
140449
def verify_hash(self, hashed_data, compare_data):
        
        return self.security.hashing_context.verify(
            encode_string(compare_data), hashed_data)
64951
def _convert_hashes(values):
    
    hashes = {}
    if not values:
        return hashes
    for value in values:
        try:
            name, value = value.split(":", 1)
        except ValueError:
            name = "sha256"
        if name not in hashes:
            hashes[name] = []
        hashes[name].append(value)
    return hashes
761551
private void refillEntry(int baseHash)
  {
    K key = _keys[baseHash];
    V value = _values[baseHash];

    _keys[baseHash] = null;
    _values[baseHash] = null;

    int hash = key.hashCode() & _mask;

    for (int count = _size; count >= 0; count--) {
      if (_values[hash] == null) {
        _keys[hash] = key;
        _values[hash] = value;
        return;
      }

      hash = (hash + 1) & _mask;
    }
  }
644358
def RawBytesToScriptHash(raw):
        
        rawh = binascii.unhexlify(raw)
        rawhashstr = binascii.unhexlify(bytes(Crypto.Hash160(rawh), encoding='utf-8'))
        return UInt160(data=rawhashstr)
419375
def hash(value):
    ''''''
    if not value:
        return
    elif len(value) == 32:
        type = 'md5'
    elif len(value) == 40:
        type = 'sha1'
    elif len(value) == 64:
        type = 'sha256'
    else:
        return None
    return {'type': type, 'value': value}
326105
def valid_hash_value(hashname):
    
    custom_hash_prefix_re = re.compile(r"^x_")
    if hashname in enums.HASH_ALGO_OV or custom_hash_prefix_re.match(hashname):
        return True
    else:
        return False