From d55695834a7e4cedebc45c57a4174afdd9a9cf9c Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 3 Mar 2015 14:25:09 -0500 Subject: [PATCH] tar/storage: deciding on crc64 for integrity hash --- tar/storage/entry.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tar/storage/entry.go b/tar/storage/entry.go index a9575db..77dc320 100644 --- a/tar/storage/entry.go +++ b/tar/storage/entry.go @@ -24,10 +24,15 @@ const ( // Entry is a the structure for packing and unpacking the information read from // the Tar archive. +// +// FileType Payload checksum is using `hash/crc64` for basic file integrity, +// _not_ for cryptography. +// From http://www.backplane.com/matt/crc64.html, CRC32 has almost 40,000 +// collisions in a sample of 18.2 million, CRC64 had none. type Entry struct { Type Type `json:"type"` Name string `json:"name",omitempty` Size int64 `json:"size",omitempty` - Payload []byte `json:"payload"` // SegmentType store payload here; FileType store checksum here; + Payload []byte `json:"payload"` // SegmentType store payload here; FileType store crc64 checksum here; Position int `json:"position"` }