Although similar to this SO question, I am not asking:
Under what conditions does an extension\'s ID change?
nor
Unpacked Chrome extensions ID is generated based on the path of it's directory. For unpacked extension you can generate the id in following way (code in Python):
import hashlib
m = hashlib.sha256()
m.update(bytes(PATH.encode('utf-8')))
EXTID = ''.join([chr(int(i, base=16) + ord('a')) for i in m.hexdigest()][:32])
where PATH is normalized path to the extension, ie.:
PATH = os.path.dirname(os.path.realpath(__file__))