Versions in this module Expand all Collapse all v1 v1.0.3 May 3, 2020 v1.0.2 May 2, 2020 Changes in this version + const CHECKSUM_CRC32 + const CHECKSUM_MD5 + const CHECKSUM_SLICE_MD5 + const DefaultBufSize + var ErrChecksumWriteAllStop = errors.New("checksum write all stop") + var ErrChecksumWriteStop = errors.New("checksum write stop") + var ErrFileIsNil = errors.New("file is nil") + type ChecksumWriteUnit struct + ChecksumWriter ChecksumWriter + End int64 + OnlySliceSum bool + SliceEnd int64 + SliceSum interface{} + Sum interface{} + func (wi *ChecksumWriteUnit) Write(p []byte) (n int, err error) + type ChecksumWriter interface + Sum func() interface{} + func NewHash32ChecksumWriter(h32 hash.Hash32) ChecksumWriter + func NewHashChecksumWriter(h hash.Hash) ChecksumWriter + type LocalFileChecksum struct + func GetFileSum(localPath string, flag int) (lfc *LocalFileChecksum, err error) + func NewLocalFileChecksum(localPath string, sliceSize int) *LocalFileChecksum + func NewLocalFileChecksumWithBufSize(localPath string, bufSize, sliceSize int) *LocalFileChecksum + func (lfc *LocalFileChecksum) Close() error + func (lfc *LocalFileChecksum) GetFile() *os.File + func (lfc *LocalFileChecksum) OpenPath() error + func (lfc *LocalFileChecksum) Sum(checkSumFlag int) (err error) + type LocalFileMeta struct + CRC32 uint32 + Length int64 + MD5 []byte + ModTime int64 + Path string + SliceMD5 []byte + func (lfm *LocalFileMeta) CompleteAbsPath() + func (lfm *LocalFileMeta) EqualLengthMD5(m *LocalFileMeta) bool