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
#!/usr/bin/env python | |
import crypt | |
import sys | |
import random | |
saltchars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" | |
def salt(): | |
return "$6$" + "".join(random.sample(saltchars, 8)) |
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
#!/usr/bin/env python | |
# Install (ubuntu/debian): | |
# ------------------------ | |
# apt-get install python-magic | |
import magic | |
ms = magic.open(magic.MAGIC_NONE) | |
ms.load() |