mirror of
https://github.com/docker/docs.git
synced 2026-03-31 00:08:55 +07:00
Reasoning:
e5d8447f06 (commitcomment-11243708)
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
10 lines
184 B
Python
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()
|