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

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)
int(x=0) -> int or long
int(x, base=10) -> int or long

Convert a number or string to an integer, or return 0 if no arguments
are given.  If x is floating point, the conversion truncates towards zero.
If x is outside the integer range, the function returns a long instead.

If x is not a number or if base is given, then x must be a string or
Unicode object representing an integer literal in the given base.  The
literal can be preceded by '+' or '-' and be surrounded by whitespace.(more...)

src/m/i/mixminion-HEAD/lib/mixminion/server/PacketHandler.py   mixminion(Download)
 
        # Replay prevention
        replayhash = keys.get(Crypto.REPLAY_PREVENTION_MODE, Crypto.DIGEST_LEN)
        if hashlog.seenHash(replayhash):
            raise ContentError("Duplicate packet detected.")

src/m/i/mixminion-HEAD/lib/mixminion/server/ServerKeys.py   mixminion(Download)
            checkPrivateFile(fn)
            r = readFile(fn)
            if len(r) == mixminion.Crypto.DIGEST_LEN:
                self.pingerSeed = r
                return r
 
        self.pingerSeed = r = mixminion.Crypto.trng(mixminion.Crypto.DIGEST_LEN)

src/m/i/mixminion-HEAD/lib/mixminion/ServerInfo.py   mixminion(Download)
     formatBase64, formatDate, formatTime, readPossiblyGzippedFile
from mixminion.Config import ConfigError
from mixminion.Crypto import CryptoError, DIGEST_LEN, pk_check_signature, \
     pk_encode_public_key, pk_fingerprint, pk_sign, sha1
 
                raise ConfigError("Missing URLBase or fingerprint in Voting-Server")
            digest = mixminion.Config._parseHex(lst[0]) # can raise ConfigError
            if len(digest) != DIGEST_LEN:
                raise ConfigError("Bad length for Voting-Server fingerprint",
                                  len(lst[0]), len(digest))
            raise ConfigError("Identity key length is out of range (%s bits)"
                              % idKeyBytes*8)
        if len(sec['Directory-Digest']) != DIGEST_LEN:
            raise ConfigError("Impossible digest length (%s)"%
                              len(sec['Directory-Digest']))

src/m/i/mixminion-HEAD/lib/mixminion/ClientUtils.py   mixminion(Download)
     createPrivateDir, floorDiv, previousMidnight, readFile, \
     succeedingMidnight, writeFile, armorText, unarmorText, MixFatalError
from mixminion.Crypto import sha1, ctr_crypt, DIGEST_LEN, AES_KEY_LEN, \
     getCommonPRNG, trng
 
    key = sha1(salt+password+salt)[:AES_KEY_LEN]
    s = ctr_crypt(s, key)
    data = s[:-DIGEST_LEN]
    digest = s[-DIGEST_LEN:]
    if digest != sha1(data+salt+magic):

src/m/i/mixminion-HEAD/lib/mixminion/server/Pinger.py   mixminion(Download)
            return '<self>'
        else:
            assert len(identity) == mixminion.Crypto.DIGEST_LEN
            return binascii.b2a_hex(identity)
 
            return '<self>'
        else:
            assert len(hexid) == mixminion.Crypto.DIGEST_LEN*2
            return binascii.a2b_hex(hexid)
 
           'hash' as its digest.
        """
        assert len(hash) == mixminion.Crypto.DIGEST_LEN
        ids = ",".join([ str(self._getServerID(s)) for s in path ])
        self._db.getCursor().execute(self._QUEUED_PING,
    def gotPing(self, hash, now=None):
        """Note that we have received a probe message whose payload had 'hash'
           as its digest.
        """
        assert len(hash) == mixminion.Crypto.DIGEST_LEN

src/m/i/mixminion-HEAD/lib/mixminion/directory/Directory.py   mixminion(Download)
                    continue
                fingerprint = _normalizeFingerprint(fingerprint)
                if len(fingerprint) != mixminion.Crypto.DIGEST_LEN * 2:
                    if not commented:
                        LOG.warn("Bad length for digest on line %s of %s",