U E D R , A S I H C RSS

MySQL/Password Function In Python

No older revisions available

No older revisions available




def mysqlPass(aStr):
    nr = 1345345333
    add = 7
    nr2 = 0x12345671

    for each in aStr:
        if each == ' ' or each == '\t': continue
        tmp = ord(each)
        nr ^= (((nr & 63) + add) * tmp) + (nr << 8)
        nr2 += (nr2 << 8) ^ nr
        add += tmp

    result1 = nr & ((1 << 31) -1)
    result2 = nr2 & ((1 << 31) -1)
    return "%08x%08x" % (result1,result2)

if __name__=="__main__":
    print mysqlPass("testing")
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:23:49
Processing time 0.0207 sec