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

All Samples(0)  |  Call(0)  |  Derive(0)  |  Import(0)

src/t/m/tmda-fork-HEAD/tmda/TMDA/Cookie.py   tmda-fork(Download)
def tmda_mac(*items):
    """Create a SHA-1 HMAC based on items (which must be strings)
    and return a hex string cropped to HMAC_BYTES."""
    mac = hmac.new(Defaults.CRYPT_KEY, ''.join(items), sha1)
    hex_size = 2 * Defaults.HMAC_BYTES
def make_fingerprint(hdrlist):
    """Expects a list of strings, and returns a full (unsliced) HMAC
    as a base64 encoded string, but with the trailing '=' and newline
    removed."""
    fp = hmac.new(Defaults.CRYPT_KEY, digestmod=sha1)