Get a hash code for given fields and values, using the given seed.
346621
@SuppressWarnings("unchecked")
  protected int hashFields(int hash, Map<FieldDescriptor, Object> map) {
    for (Map.Entry<FieldDescriptor, Object> entry : map.entrySet()) {
      FieldDescriptor field = entry.getKey();
      Object value = entry.getValue();
      hash = (37 * hash) + field.getNumber();
      if (field.getType() != FieldDescriptor.Type.ENUM){
        hash = (53 * hash) + value.hashCode();
      } else if (field.isRepeated()) {
        List<? extends EnumLite> list = (List<? extends EnumLite>) value;
        hash = (53 * hash) + hashEnumList(list);
      } else {
        hash = (53 * hash) + hashEnum((EnumLite) value);
      }
    }
    return hash;
  }
1263910
def hash(self):
        """"""
        data_str = ';'.join(
            [str(repr(var)) for var in
             [self.N, self.K, self.X, self.L,
              self.stat, self.cutoff, self.pval,
              self.pval_thresh, self.escore_pval_thresh]])
        data_str += ';'
        data = data_str.encode('UTF-8') + self.indices.tobytes()
        return str(hashlib.md5(data).hexdigest())
1257072
def ensureHashIndex(self, fields, unique = False, sparse = True, deduplicate = False) :
        """"""
        data = {
            "type" : "hash",
            "fields" : fields,
            "unique" : unique,
            "sparse" : sparse,
            "deduplicate": deduplicate
        }
        ind = Index(self, creationData = data)
        self.indexes["hash"][ind.infos["id"]] = ind
        return ind
919935
def read_and_hash(fname, **kw):
    '''
    
    '''
    return [addhash(frame, **kw) for frame in read(fname, **kw)];
1120344
public static int hash(int input)
    {
        int k1 = mixK1(input);
        int h1 = mixH1(DEFAULT_SEED, k1);

        return fmix(h1, SizeOf.SIZE_OF_INT);
    }
415903
public static long hash(final long in, final long seed) {
    long hash = seed + P5;
    hash += 8;
    long k1 = in;
    k1 *= P2;
    k1 = Long.rotateLeft(k1, 31);
    k1 *= P1;
    hash ^= k1;
    hash = (Long.rotateLeft(hash, 27) * P1) + P4;
    return finalize(hash);
  }
898470
def _ComputeHash( key, seed = 0x0 ):
        
        def fmix( h ):
            h ^= h >> 16
            h  = ( h * 0x85ebca6b ) & 0xFFFFFFFF
            h ^= h >> 13
            h  = ( h * 0xc2b2ae35 ) & 0xFFFFFFFF
            h ^= h >> 16
            return h

        length = len( key )
        nblocks = int( length / 4 )

        h1 = seed

        c1 = 0xcc9e2d51
        c2 = 0x1b873593

        # body
        for block_start in xrange( 0, nblocks * 4, 4 ):
            k1 = key[ block_start + 3 ] << 24 | \
                 key[ block_start + 2 ] << 16 | \
                 key[ block_start + 1 ] <<  8 | \
                 key[ block_start + 0 ]
             
            k1 = c1 * k1 & 0xFFFFFFFF
            k1 = ( k1 << 15 | k1 >> 17 ) & 0xFFFFFFFF # inlined ROTL32
            k1 = ( c2 * k1 ) & 0xFFFFFFFF
        
            h1 ^= k1
            h1  = ( h1 << 13 | h1 >> 19 ) & 0xFFFFFFFF # inlined _ROTL32 
            h1  = ( h1 * 5 + 0xe6546b64 ) & 0xFFFFFFFF

        # tail
        tail_index = nblocks * 4
        k1 = 0
        tail_size = length & 3

        if tail_size >= 3:
            k1 ^= key[ tail_index + 2 ] << 16
        if tail_size >= 2:
            k1 ^= key[ tail_index + 1 ] << 8
        if tail_size >= 1:
            k1 ^= key[ tail_index + 0 ]
    
        if tail_size != 0:
            k1  = ( k1 * c1 ) & 0xFFFFFFFF
            k1  = ( k1 << 15 | k1 >> 17 ) & 0xFFFFFFFF # _ROTL32
            k1  = ( k1 * c2 ) & 0xFFFFFFFF
            h1 ^= k1

        return fmix( h1 ^ length )
1021642
def hash(self):
        '''
        
        '''
        hashed = super(TakeFrom, self).hash()
        return khash(hashed, self.min_elements, self.max_elements, self.seed)
811020
def get_hash(node,fields = None,exclude = ['pk','_id'],target = 'pk'):
    

    hasher = Hasher()

    def add_to_hash(value):

        if isinstance(value,dict):
            if target in value:
                add_to_hash(value[target])
            else:
                attribute_list = []
                for key,v in sorted(value.items(),key = lambda x: x[0]):

                    if (fields is not None and key not in fields) \
                        or (exclude is not None and key in exclude):
                        continue
                    add_to_hash(key)
                    add_to_hash(v)
        elif isinstance(value,(tuple,list)) and value and isinstance(value[0],(dict,node_class)):
            for i,v in enumerate(value):
                hasher.add(i)
                add_to_hash(v)
        else:
            hasher.add(value)

    add_to_hash(node)

    return hasher.digest.hexdigest()
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
387971
public static long hash64(byte[] data, int offset, int length, int seed) {
        long hash = seed;
        final int nblocks = length >> 3;

        // body
        for (int i = 0; i < nblocks; i++) {
            final int i8 = i << 3;
            long k = ((long) data[offset + i8] & 0xff)
                | (((long) data[offset + i8 + 1] & 0xff) << 8)
                | (((long) data[offset + i8 + 2] & 0xff) << 16)
                | (((long) data[offset + i8 + 3] & 0xff) << 24)
                | (((long) data[offset + i8 + 4] & 0xff) << 32)
                | (((long) data[offset + i8 + 5] & 0xff) << 40)
                | (((long) data[offset + i8 + 6] & 0xff) << 48)
                | (((long) data[offset + i8 + 7] & 0xff) << 56);

            // mix functions
            k *= C1;
            k = Long.rotateLeft(k, R1);
            k *= C2;
            hash ^= k;
            hash = Long.rotateLeft(hash, R2) * M + N1;
        }

        // tail
        long k1 = 0;
        int tailStart = nblocks << 3;
        switch (length - tailStart) {
            case 7:
                k1 ^= ((long) data[offset + tailStart + 6] & 0xff) << 48;
            case 6:
                k1 ^= ((long) data[offset + tailStart + 5] & 0xff) << 40;
            case 5:
                k1 ^= ((long) data[offset + tailStart + 4] & 0xff) << 32;
            case 4:
                k1 ^= ((long) data[offset + tailStart + 3] & 0xff) << 24;
            case 3:
                k1 ^= ((long) data[offset + tailStart + 2] & 0xff) << 16;
            case 2:
                k1 ^= ((long) data[offset + tailStart + 1] & 0xff) << 8;
            case 1:
                k1 ^= ((long) data[offset + tailStart] & 0xff);
                k1 *= C1;
                k1 = Long.rotateLeft(k1, R1);
                k1 *= C2;
                hash ^= k1;
        }

        // finalization
        hash ^= length;
        hash = fmix64(hash);

        return hash;
    }
1267660
protected int lobHashCode(int seed, SymbolTableProvider symbolTableProvider)
    {
        int result = seed;

        if (!isNullValue())  {
            CRC32 crc = new CRC32();
            crc.update(getBytes());
            result ^= (int) crc.getValue();
        }

        return hashTypeAnnotations(result, symbolTableProvider);
    }
1243696
def GetHashObject(self):
    """"""
    hash_object = rdf_crypto.Hash()
    hash_object.num_bytes = self._bytes_read
    for algorithm in self._hashers:
      setattr(hash_object, algorithm, self._hashers[algorithm].digest())
    return hash_object
1019224
public static long[] hash(final String in, final long seed, final long[] hashOut) {
    if ((in == null) || (in.length() == 0)) {
      return emptyOrNull(seed, hashOut);
    }
    final byte[] byteArr = in.getBytes(UTF_8);
    return hash(Memory.wrap(byteArr), 0L, byteArr.length, seed, hashOut);
  }
582029
def get_next_seed(key, seed):
        
        return hmac.new(key, seed, hashlib.sha256).digest()
1368523
def to_hash
      field_hash = {@tag=>{'ind1'=>@indicator1,'ind2'=>@indicator2,'subfields'=>[]}}
      self.each do |subfield|
        field_hash[@tag]['subfields'] << {subfield.code=>subfield.value}
      end
      field_hash
    end
1025382
public static function generateKeys($seed = null, $hashKey = '')
    {
        # The keys are being generated from a seed.
        if ($seed !== null) {
            # Generate some repeatable hashes to create keys against for recovery
            $encrHash = Hash::hash($seed, $hashKey, Constants::BOX_SEEDBYTES);
            $signHash = Hash::hash($seed, $hashKey, Constants::SIGN_SEEDBYTES);

            # Build recoverable pre-seeded key pairs.
            $seeds = [
                'encr' => \Sodium\crypto_box_keypair($encrHash),
                'sign' => \Sodium\crypto_sign_keypair($signHash),
            ];
        } else {
            # Build un-recoverable key pairs.
            $seeds = [
                'encr' => \Sodium\crypto_box_keypair(),
                'sign' => \Sodium\crypto_sign_keypair(),
            ];
        }

        # Return the two generated key pairs to the client.
        return [
            'encr' => [
                'pri' => Helpers::bin2hex(\Sodium\crypto_box_secretkey($seeds['encr'])),
                'pub' => Helpers::bin2hex(\Sodium\crypto_box_publickey($seeds['encr'])),
            ],
            'sign' => [
                'pri' => Helpers::bin2hex(\Sodium\crypto_sign_secretkey($seeds['sign'])),
                'pub' => Helpers::bin2hex(\Sodium\crypto_sign_publickey($seeds['sign'])),
            ],
        ];
    }