mirror of
https://github.com/restic/restic.git
synced 2026-08-17 19:13:18 +00:00
repository: add PackBlob.UncompressedCiphertextLength()
This commit is contained in:
@@ -27,6 +27,10 @@ func (b Blob) DataLength() uint {
|
||||
return uint(crypto.PlaintextLength(int(b.Length)))
|
||||
}
|
||||
|
||||
func (b Blob) UncompressedCiphertextLength() uint {
|
||||
return uint(crypto.CiphertextLength(int(b.DataLength())))
|
||||
}
|
||||
|
||||
func (b Blob) IsCompressed() bool {
|
||||
return b.UncompressedLength != 0
|
||||
}
|
||||
|
||||
@@ -8,12 +8,18 @@ type PackedBlob struct {
|
||||
Blob Blob
|
||||
}
|
||||
|
||||
var _ restic.PackBlob = (*PackedBlob)(nil)
|
||||
|
||||
func (pb *PackedBlob) PackID() restic.ID { return pb.Pack }
|
||||
|
||||
func (pb *PackedBlob) Handle() restic.BlobHandle { return pb.Blob.BlobHandle }
|
||||
|
||||
func (pb *PackedBlob) CiphertextLength() uint { return pb.Blob.Length }
|
||||
|
||||
func (pb *PackedBlob) UncompressedCiphertextLength() uint {
|
||||
return pb.Blob.UncompressedCiphertextLength()
|
||||
}
|
||||
|
||||
func (pb *PackedBlob) PlaintextLength() uint { return pb.Blob.DataLength() }
|
||||
|
||||
func (pb *PackedBlob) IsCompressed() bool { return pb.Blob.IsCompressed() }
|
||||
|
||||
Reference in New Issue
Block a user