#NEWLINE# @ internationalizeDocstring #NEWLINE# def crypt( self , irc , msg , args , password , salt ) : #NEWLINE# #INDENT# "<password> [<salt>]\n\n        Returns the resulting of doing a crypt() on <password>.  If <salt> is\n        not given, uses a random salt.  If running on a glibc2 system,\n        prepending '$1$' to your salt will cause crypt to return an MD5sum\n        based crypt rather than the standard DES based crypt.\n        " #NEWLINE# def makeSalt( ) : #NEWLINE# #INDENT# s = b'\x00' #NEWLINE# while ( self . _cryptre . sub ( b'' , s ) != b'' ) : #NEWLINE# #INDENT# s = struct . pack ( '<h' , random . randrange ( ( - ( 2 ** 15 ) ) , ( 2 ** 15 ) ) ) #NEWLINE# #UNINDENT# return s #NEWLINE# #UNINDENT# if ( not salt ) : #NEWLINE# #INDENT# salt = makeSalt ( ) . decode ( ) #NEWLINE# #UNINDENT# irc . reply ( crypt . crypt ( password , salt ) )