MCPcopy Create free account
hub / github.com/ampproject/amphtml / __init__

Method __init__

validator/validator_gen_js.py:84–88  ·  view source on GitHub ↗
(self, proto_message)

Source from the content-addressed store, hash-verified

82 """
83
84 def __init__(self, proto_message):
85 self.type_name = proto_message.DESCRIPTOR.name
86 # While it's not strictly necessary to use a digest here, we do so
87 # to avoid carrying around the whole serialized string all the time.
88 self.digest = hashlib.sha1(proto_message.SerializeToString()).hexdigest()
89
90 def __hash__(self):
91 return hash((self.type_name, self.digest))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected