aboutsummaryrefslogtreecommitdiff
path: root/zsig
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-07-09 13:05:42 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-07-09 13:05:42 +0200
commitd52375efeefe85d4d241f3fec5a3f7c37c36e331 (patch)
treebc287493b0261a1c8b6f3b251cede2c42482e261 /zsig
parentddc9f9f5ab245a30ad5369bf9eb76033d3dbe9bf (diff)
Print blocks
Diffstat (limited to 'zsig')
-rw-r--r--zsig/sum.go5
-rw-r--r--zsig/zsig.go2
-rw-r--r--zsig/zsig_test.go5
3 files changed, 9 insertions, 3 deletions
diff --git a/zsig/sum.go b/zsig/sum.go
index 846a140..7ce9a9d 100644
--- a/zsig/sum.go
+++ b/zsig/sum.go
@@ -5,6 +5,11 @@ import (
"io"
)
+const (
+ Algoritghm = "SHA512/256"
+ BlockSize = 65536
+)
+
// Sum calculates SHA512/256
func Sum(r io.Reader, blockSize int) chan []byte {
c := make(chan []byte, 1)
diff --git a/zsig/zsig.go b/zsig/zsig.go
index 6c7c16a..d9e6530 100644
--- a/zsig/zsig.go
+++ b/zsig/zsig.go
@@ -22,8 +22,6 @@ const (
flagComment = 1 << 4
)
-const BlockSize = 65536
-
var fake = []byte{gzipID1, gzipID2, gzipDeflate, flagComment, 0, 0, 0, 0, 0, 3}
type Header struct {
diff --git a/zsig/zsig_test.go b/zsig/zsig_test.go
index a438b61..001d11d 100644
--- a/zsig/zsig_test.go
+++ b/zsig/zsig_test.go
@@ -23,8 +23,11 @@ func TestZsig(t *testing.T) {
if err != nil {
t.Error(err)
}
-
t.Log(z.Header)
+
+ for block := range Sum(z, BlockSize) {
+ t.Logf("%x", block)
+ }
})
}
}