Minor refactoring: extract variable...

This commit is contained in:
Jakob Borg 2014-07-26 21:28:32 +02:00
parent b7176d2204
commit 49cb931572

View File

@ -14,6 +14,8 @@ import (
const StandardBlockSize = 128 * 1024 const StandardBlockSize = 128 * 1024
var sha256OfNothing = []uint8{0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55}
// Blocks returns the blockwise hash of the reader. // Blocks returns the blockwise hash of the reader.
func Blocks(r io.Reader, blocksize int) ([]protocol.BlockInfo, error) { func Blocks(r io.Reader, blocksize int) ([]protocol.BlockInfo, error) {
var blocks []protocol.BlockInfo var blocks []protocol.BlockInfo
@ -44,7 +46,7 @@ func Blocks(r io.Reader, blocksize int) ([]protocol.BlockInfo, error) {
blocks = append(blocks, protocol.BlockInfo{ blocks = append(blocks, protocol.BlockInfo{
Offset: 0, Offset: 0,
Size: 0, Size: 0,
Hash: []uint8{0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55}, Hash: sha256OfNothing,
}) })
} }