Get (and maybe create) a hash by name.
770710
def _get_hash(self, name, operation, create=False):
        
        return self._get_by_type(name, operation, create, b'hash', {})
458664
function (name) {
        return Array.isArray(name) ? (name.map(this.valueOf.bind(this))) : this.hash[name];
    }
172348
def get_by_name(self, name):
        
        san_managers = self._client.get_all()
        result = [x for x in san_managers if x['name'] == name]
        return result[0] if result else None
398353
def make_hash(s, n_bytes):
    """"""
    raw_h = int(md5(s.encode('utf-8')).hexdigest()[:n_bytes], 16)
    # Make it a signed int.
    return 16**n_bytes//2 - raw_h
218033
def mangle(self, name, x):
        
        h = abs(hash(name))
        return '%s-%s' % (h, x)
365541
def get_name_value_hash_txid( self, name, value_hash ):
        
        rec = self.get_name( name )
        if rec is None:
            return None 

        if rec['revoked']:
            return None
        
        # find the txid of the given value hash
        if rec['value_hash'] == value_hash:
            return rec['txid']

        else:
            # search backwards for it 
            hist = rec['history']
            flat_hist = namedb_flatten_history( hist )
            for i in xrange(len(flat_hist)-1, 0, -1):
                delta = flat_hist[i]
                if delta['op'] == NAME_PREORDER:
                    # this name was re-registered. skip
                    return None 

                if delta['value_hash'] == value_hash:
                    # this is the txid that affected it 
                    return delta['txid']

            # not found
            return None
129811
def to_hash
      Hash[instance_variables.map { |name| [name.to_s.delete('@').to_sym, instance_variable_get(name)] }]
    end
13012
def hash(self):
        """"""
        if not hasattr(self, "__hash"):
            self.__hash = self._calculate_hash()
        return self.__hash
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
721321
def hash(cls, path, digest=None, hasher=sha1):
    """"""
    if digest is None:
      digest = hasher()
    with open(path, 'rb') as fh:
      cls.update_hash(fh, digest)
    return digest.hexdigest()
303151
def get_name_by_preorder( self, preorder_hash ):
        
        cur = self.db.cursor()
        return namedb_get_name_by_preorder_hash( cur, preorder_hash )
65232
def named(self, name):
        ''''''
        name = self.serialize(name)
        return self.get_by('name', name)
1043089
function (name, params) {
        return {
          name: name || to.name,
          params: params ? Object.assign(to.params, params) : to.params,
          hash: to.hash,
          query: to.query
        }
      }
538002
def getblock(self, hash: str) -> dict:
        ''''''

        return cast(dict, self.api_fetch('getblock?hash=' + hash))
1170299
def to_h
      Hash[
        attribute_names.
        map do |name| [
          name.to_s.gsub("@","").to_sym,  # key
          (instance_variable_get(name) rescue send(name))] # val
        end
      ]
    end
1063148
def get_index_by_name(self, name):
        """"""
        for i in range(self.n_blocks):
            if self.get_block_name(i) == name:
                return i
        raise KeyError('Block name ({}) not found'.format(name))
1020003
def _hash(self, hash_name):
        
        m = hashlib.new(hash_name)
        for chunk in self.chunks(8192, mode="rb"):
            m.update(chunk)
        return m