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

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
Given a unicode_object like a pathname, returns the integer representing the first two bytes of the MD5 hash of the argument.

        def getHashFirstTwoBytes(unicode_object):
    '''
    Given a unicode_object like a pathname, returns the integer representing the first two bytes of the MD5 hash of the argument.
    '''
    m = md5()    
    m.update( unicode_object.encode('utf-8') )    
    blob= m.digest()    
    x = ord(blob[0]) +  ord(blob[1])*256    
    return x
        


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
        #total= len(pathname) % MAX_TOWER_HEIGHT        
 
        x = getHashFirstTwoBytes(pathname)                      
        height = 1 
        stop = False