Skip to content

Instantly share code, notes, and snippets.

@geek-id
Created August 2, 2018 13:45
Show Gist options
  • Save geek-id/624dd90e2cc5a7f170500d109d4dfde5 to your computer and use it in GitHub Desktop.
Save geek-id/624dd90e2cc5a7f170500d109d4dfde5 to your computer and use it in GitHub Desktop.
Read all file in directory and create hash
import glob
import hashlib
import time
import os
userdata = glob.glob('/home/geekid/Github/ssl/*')
userdata.sort(key=os.path.getmtime)
def new():
data = ''
for getdata in userdata:
data += getdata + '\n'
gethash = hashlib.sha1(data).hexdigest()
print "data baru"
# return data
print gethash
print data
new = new()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment