def pbkdf2_bin(data, salt, iterations=1000, keylen=24, hashfunc=None):
    hashfunc = hashfunc or sha1
    mac = hmac.new(data, None, hashfunc)
    def _pseudorandom(x, mac=mac):
        h = mac.copy()
        h.update(x)
        return h.digest()
    buf = deque()
    for block in xrange(1, -(-keylen // mac.digest_size) + 1):
        rv = u = _pseudorandom(salt + _pack_int(block))
        for i in xrange(iterations - 1):
            u = _pseudorandom(u)
            rv = strxor(rv, u)
        buf.extend(rv)
    return ''.join(buf)[:keylen]
Get the requests options from salt.
dataset/ETHPy150Open uwdata/termite-data-server/web2py/gluon/contrib/pbkdf2.py/pbkdf2_bin--crossover with--dataset/ETHPy150Open saltstack/salt/salt/returners/nagios_return.py/_prepare_xml