MCPcopy Create free account
hub / github.com/ethstorage/es-node / BlobToVersionedHash

Function BlobToVersionedHash

ethstorage/blobs/blob.go:20–28  ·  view source on GitHub ↗
(blobBytes []byte)

Source from the content-addressed store, hash-verified

18}
19
20func BlobToVersionedHash(blobBytes []byte) (common.Hash, error) {
21 var blob kzg4844.Blob
22 copy(blob[:], blobBytes)
23 cmt, err := kzg4844.BlobToCommitment(&blob)
24 if err != nil {
25 return common.Hash{}, fmt.Errorf("blobToCommitment failed: %w", err)
26 }
27 return common.Hash(kzg4844.CalcBlobHashV1(sha256.New(), &cmt)), nil
28}

Callers 2

DownloadBlobsMethod · 0.92
downloadBlobFromRPCFunction · 0.92

Calls 1

HashMethod · 0.65

Tested by

no test coverage detected