Return generator by hash generator family name and digest size

		:param family: name of hash-generator family

		:return: WHashGeneratorProto class
342451
def generator_by_digest(family, digest_size):
		
		for generator_name in WHash.available_generators(family=family):
			generator = WHash.generator(generator_name)
			if generator.generator_digest_size() == digest_size:
				return generator
		raise ValueError('Hash generator is not available')
36575
def get_fragment_generator(self, gp, **kwargs):
        
        collector = FragmentCollector(self.__host, gp)
        return collector.get_fragment_generator(**kwargs)
673925
def peak_generation(self):
        
        if self._peak_generation is None:
            self._peak_generation = sum(
                [gen.nominal_capacity
                 for gen in self.generators])

        return self._peak_generation
259346
def hash(self):
        '''
        
        '''
        hashed = super(String, self).hash()
        return khash(hashed, self._max_size)
130911
def hash(self):
        '''
        
        '''
        hashed = super(RandomBits, self).hash()
        return khash(hashed, self._min_length, self._max_length, self._num_mutations, self._step, self._seed)
491544
def _cli_check_family(family, data_dir):
    ''''''

    if family is None:
        return None

    family = family.lower()
    if not family in api.get_families(data_dir):
        errstr = "Basis set family '" + family + "' does not exist.\n"
        errstr += "For a complete list of families, use the 'bse list-families' command"
        raise RuntimeError(errstr)

    return family
213991
def hash(self):
        '''
        
        '''
        hashed = super(Trunc, self).hash()
        return khash(hashed, self._max_size)
1163069
def cache_generator(self, key, generator):
        """"""
        results = []
        for result in generator:
            results.append(result)
            yield result

        self.inferred[key] = tuple(results)
591132
def update_family(self):
        """"""
        self.chain.connection.log("Detecting hw family")
        family = self.driver.get_hw_family(self.version_text)
        if family:
            self.chain.connection.log("HW Family: {}".format(family))
            self.family = family
347458
def from_parent(cls,
                    parent: 'BlockHeader',
                    gas_limit: int,
                    difficulty: int,
                    timestamp: int,
                    coinbase: Address=ZERO_ADDRESS,
                    nonce: bytes=None,
                    extra_data: bytes=None,
                    transaction_root: bytes=None,
                    receipt_root: bytes=None) -> 'BlockHeader':
        
        header_kwargs = {
            'parent_hash': parent.hash,
            'coinbase': coinbase,
            'state_root': parent.state_root,
            'gas_limit': gas_limit,
            'difficulty': difficulty,
            'block_number': parent.block_number + 1,
            'timestamp': timestamp,
        }
        if nonce is not None:
            header_kwargs['nonce'] = nonce
        if extra_data is not None:
            header_kwargs['extra_data'] = extra_data
        if transaction_root is not None:
            header_kwargs['transaction_root'] = transaction_root
        if receipt_root is not None:
            header_kwargs['receipt_root'] = receipt_root

        header = cls(**header_kwargs)
        return header
646235
def hash(self):
        """"""
        # Do not apply filters here (speed)
        hph = self.hparent.hash
        hpfilt = hashobj(self.hparent._filter)
        dhash = hashobj(hph + hpfilt)
        return dhash
1058025
def lookup_family_by_name(name):
    
    for ops in nl_list_for_each_entry(genl_ops(), genl_ops_list, 'o_list'):
        if ops.o_name == name:
            return ops
    return None
1234382
def _family_id_to_superclass(self, family_id):
        
        for family in [XBlock, XBlockAside]:
            if family_id == family.entry_point:
                return family
        raise ValueError('No such family: {}'.format(family_id))
396069
String hash(TemplateClass tc) {
        try {
            //Object enhancer = engine.conf().byteCodeEnhancer();
            MessageDigest messageDigest = MessageDigest.getInstance("MD5");
            messageDigest.reset();
            messageDigest.update((engine.version() + tc.getTemplateSource(true)).getBytes("utf-8"));
            byte[] digest = messageDigest.digest();
            StringBuilder builder = new StringBuilder();
            for (int i = 0; i < digest.length; ++i) {
                int value = digest[i];
                if (value < 0) {
                    value += 256;
                }
                builder.append(Integer.toHexString(value));
            }
            return builder.toString();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
695516
def cache_id(self) -> str:
        

        if self._cache_id:
            return self._cache_id

        with open(join(expanduser('~'), '.indy_client', 'pool', self.name, '{}.txn'.format(self.name))) as fh_genesis:
            genesis = [json.loads(line) for line in fh_genesis.readlines() if line]

        hps = []
        for gen_txn in genesis:
            hps.append(self.protocol.genesis_host_port(gen_txn))
        hps.sort()  # canonicalize to make order irrelevant
        self._cache_id = ':'.join('{}:{}'.format(hp[0], hp[1]) for hp in hps)

        return self._cache_id
170525
def each
      pos = hash_size
      hoff0 = @hashes[0]
      while pos < hoff0
        key, value = *read_entry(pos)
        yield(key,value)
        pos += key.length + value.length + hashref_size
      end
    end
1021642
def hash(self):
        '''
        
        '''
        hashed = super(TakeFrom, self).hash()
        return khash(hashed, self.min_elements, self.max_elements, self.seed)