Use LevelDB storage backend
This commit is contained in:
@@ -7,6 +7,7 @@ package scanner
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"io"
|
||||
)
|
||||
|
||||
@@ -18,6 +19,10 @@ type Block struct {
|
||||
Hash []byte
|
||||
}
|
||||
|
||||
func (b Block) String() string {
|
||||
return fmt.Sprintf("%d/%d/%x", b.Offset, b.Size, b.Hash)
|
||||
}
|
||||
|
||||
// Blocks returns the blockwise hash of the reader.
|
||||
func Blocks(r io.Reader, blocksize int) ([]Block, error) {
|
||||
var blocks []Block
|
||||
|
||||
Reference in New Issue
Block a user