What program can I use to rename files with their calculated md5 checksums? GUI or CLI Programs for Linux or Windows or scripts for DOS or the Linux terminal.
Asked
Active
Viewed 3,326 times
1 Answers
1
This will work in Python if it is what you are looking for. It will take and calculate an md5 for a file and then rename the file that sum. Will work on *nix/Windows/?
/usr/bin/env python
import os, hashlib
file = 'path/to/file'
def main():
h = hashlib.md5(file)
output = h.hexdigest()
os.rename( file, output)
if __name__ == '__main__':
main()
Matty
- 324