1
0
mirror of https://github.com/docker/docs.git synced 2026-10-31 10:34:26 +03:00
Files
docs/compose/utils.py
2015-05-20 16:02:08 +01:00

10 lines
184 B
Python

import json
import hashlib
def json_hash(obj):
dump = json.dumps(obj, sort_keys=True, separators=(',', ':'))
h = hashlib.sha256()
h.update(dump)
return h.hexdigest()