Skip to content

Instantly share code, notes, and snippets.

@luxuia
Created November 1, 2018 09:15
Show Gist options
  • Save luxuia/c02a2519e3bf17e6261604db03d55fea to your computer and use it in GitHub Desktop.
Save luxuia/c02a2519e3bf17e6261604db03d55fea to your computer and use it in GitHub Desktop.
计算obb hash的python方法
#!/usr/bin/python
#coding: utf8
import os
import sys
print(str(sys.argv))
obb =sys.argv[1]
def md5(file):
import hashlib
md5_value = hashlib.md5()
with open(file, "rb") as file:
file_len = file.seek(0, 2)
file.seek(-min(file_len, 65558), 2)
data = file.read()
md5_value.update(data)
return md5_value.hexdigest()
print( md5(obb) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment