def hash_bytes(buf):
sha256 = hashlib.sha256()<EOL>sha256.update(buf)<EOL>return '<STR_LIT>' + sha256.hexdigest()<EOL>
Hash bytes using the same method the registry uses (currently SHA-256).

:param buf: Bytes to hash
:type buf: binary str

:rtype: str
:returns: Hex-encoded hash of file's content (prefixed by ``sha256:``)