commp

package module
v2.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2024 License: Apache-2.0, MIT Imports: 13 Imported by: 6

README

go-commp-utils

Utilities for generating and working with CommP for Filecoin pieces

License

Dual-licensed under MIT + Apache 2.0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePieceCIDFromFile

func GeneratePieceCIDFromFile(proofType abi.RegisteredSealProof, piece io.Reader, pieceSize abi.UnpaddedPieceSize) (cid.Cid, error)

GeneratePieceCIDFromFile generates an a piece cid from an io.Reader

func PieceAggregateCommP

func PieceAggregateCommP(proofType abi.RegisteredSealProof, pieceInfos []abi.PieceInfo) (cid.Cid, abi.PaddedPieceSize, error)

PieceAggregateCommP generates an aggregate CommP for a list of pieces that combine in size up to the sector size determined by the proofType parameter.

This function makes no assumptions, other than maximum size, about the pieces that you include. To create a correctly formed UnsealedCID (CommD) for a sector using this method, you should first ensure that the pieces add up to the required size.

func ZeroPadPieceCommitment

func ZeroPadPieceCommitment(c cid.Cid, curSize abi.UnpaddedPieceSize, toSize abi.UnpaddedPieceSize) (cid.Cid, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL