Duke's Fuqua School of Business
HYPERLINK "" # Simple Hashing Program in Python__author__ = ''import randomimport hashlibimport timeptarget = '0000' # Put the target number of leading zeros you want hereheader = 'Cam Harvey is Satoshi' # I am hashing my name + noncenonce = 1 # Nonce starts at 1 and increments until target hit p = 'abc'start_t = time.time()while p != ptarget: testval = str.encode(header + str(nonce)) hash_object = hashlib.sha256(testval) hex_dig = hash_object.hexdigest() nonce += 1 p = hex_dig[0:len(ptarget)]secs = time.time() - start_tmins, secs = divmod(secs, 60)hours, mins = divmod(mins, 60)print(p, nonce-1)print('%02d:%02d:%05.2f' % (hours, mins, secs))print(hex_dig)Other Py resources: ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- wharton school of business requirements
- wharton school of business application
- forbes school of business ranking
- wharton school of business courses
- wharton school of business admission
- wharton school of business ranking
- wharton school of business admissions
- wharton school of business online
- wharton school of business mba
- wharton school of business certificates
- wharton school of business undergraduate
- school of business rankings