code: def json_hash(obj, digest=None, encoder=None):
    
    json_str = json.dumps(obj, ensure_ascii=True, allow_nan=False, sort_keys=True, cls=encoder)
    return hash_all(json_str, digest=digest)
docs: Hashes `obj` by dumping to JSON.
  
    :param obj: An object that can be rendered to json using the given `encoder`.
    :param digest: An optional `hashlib` compatible message digest. Defaults to `hashlib.sha1`.
    :param encoder: An optional custom json encoder.
    :type encoder: :class:`json.JSONEncoder`
    :returns: A hash of the given `obj` according to the given `encoder`.
    :rtype: str
  
    :API: public