dddp/alea.py
def seed(self, values):
        """Seed internal state from supplied values."""
        if not values:
            # Meteor uses epoch seconds as the seed if no args supplied, we use
            # a much more secure seed by default to avoid hash collisions.
            seed_ids = [int, str, random, self, values, self.__class__]
            random.shuffle(seed_ids)
            values = list(map(id, seed_ids)) + [time.time(), os.urandom(512)]

        mash = Mash()
        self.c = 1
        self.s0 = mash(' ')
        self.s1 = mash(' ')
        self.s2 = mash(' ')

        for val in values:
            self.s0 -= mash(val)
            if self.s0 < 0:
                self.s0 += 1
            self.s1 -= mash(val)
            if self.s1 < 0:
                self.s1 += 1
            self.s2 -= mash(val)
            if self.s2 < 0:
                self.s2 += 1
def seed(self, values):
        if not values:
            # Meteor uses epoch seconds as the seed if no args supplied, we use
            # a much more secure seed by default to avoid hash collisions.
            seed_ids = [int, str, random, self, values, self.__class__]
            random.shuffle(seed_ids)
            values = list(map(id, seed_ids)) + [time.time(), os.urandom(512)]

        mash = Mash()
        self.c = 1
        self.s0 = mash(' ')
        self.s1 = mash(' ')
        self.s2 = mash(' ')

        for val in values:
            self.s0 -= mash(val)
            if self.s0 < 0:
                self.s0 += 1
            self.s1 -= mash(val)
            if self.s1 < 0:
                self.s1 += 1
            self.s2 -= mash(val)
            if self.s2 < 0:
                self.s2 += 1
def seed ( self , values ) : if not values : # Meteor uses epoch seconds as the seed if no args supplied, we use # a much more secure seed by default to avoid hash collisions. seed_ids = [ int , str , random , self , values , self . __class__ ] random . shuffle ( seed_ids ) values = list ( map ( id , seed_ids ) ) + [ time . time ( ) , os . urandom ( 512 ) ] mash = Mash ( ) self . c = 1 self . s0 = mash ( ' ' ) self . s1 = mash ( ' ' ) self . s2 = mash ( ' ' ) for val in values : self . s0 -= mash ( val ) if self . s0 < 0 : self . s0 += 1 self . s1 -= mash ( val ) if self . s1 < 0 : self . s1 += 1 self . s2 -= mash ( val ) if self . s2 < 0 : self . s2 += 1
Seed internal state from supplied values.
Seed internal state from supplied values .