Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Generate Chrome Application ID
import hashlib
def getChromeApplicationId(pathname):
if len(pathname) > 1 and pathname[0].islower() and pathname[1] == ":":
pathname = pathname[0].upper() + pathname[1:]
pathname = pathname.encode("utf-16le")
offset = ord("a")
applicationId = "".join([chr(int(digit, 16) + offset) for digit in hashlib.sha256(pathname).hexdigest()[:32]])
return applicationId
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.