Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
This method hashes a list of strings or unicode objects, concatenating them.
Nones are considered empty strings.    

        def getHash(elements_to_combine):
    '''
    This method hashes a list of strings or unicode objects, concatenating them.
    Nones are considered empty strings.    
    '''
    hash_function = md5   
    combination = ''.join( [e.encode('utf-8') for e in elements_to_combine if not e == None] )    
    m = hash_function()
    m.update(combination)
    answer = m.hexdigest()    
    return(answer)
        


src/f/i/FileRock-Client-HEAD/FileRockSharedLibraries/IntegrityCheck/SkipListNode.py   FileRock-Client(Download)
 
import logging
from Hashing import getHash, encode
POSITIVE_INFINITE = u'+INF'
NEGATIVE_INFINITE = u'-INF'
            if self.filehash == None: raise MalformedNodeException("Leaf of %s has None filehash!" % repr(self.pathname))            
            if isinstance( self.right_child, SkipListNode ):                
                self.label = getHash( [ encode(self.pathname), self.filehash, self.right_child.computeLabel(forced) ] )
            else:
                encoded = encode(self.pathname)                
                self.label = encoded+self.filehash
        else: 
            if not isinstance(self.right_child, SkipListNode): self.label = self.lower_child.computeLabel(forced)
            else: self.label = getHash([self.lower_child.computeLabel(forced), self.right_child.computeLabel(forced)])

src/f/i/FileRock-Client-HEAD/FileRockSharedLibraries/IntegrityCheck/SkipList.py   FileRock-Client(Download)
 
from Proof import Proof
from Hashing import getHash, getHashFirstTwoBytes
from random import choice
from SkipListNode import SkipListNode, ProxyNode