Created
May 21, 2012 16:11
-
-
Save mkolb/2763067 to your computer and use it in GitHub Desktop.
A function for generating a password salt in moodle, useful for first-time creation of config.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun insert-password-salt () | |
"Insert a string of length 31 suitable for a new password salt in moodle." | |
(interactive) | |
(let ((mycharset "1234567890abcdefghijklmnopqrstyvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()")) | |
(dotimes (i 31) | |
(insert (elt mycharset (random (length mycharset))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment