lint: fix issues in examples (#49)
This commit is contained in:
@@ -4,11 +4,13 @@ import (
|
||||
"encoding/binary"
|
||||
)
|
||||
|
||||
const (
|
||||
Size = 20
|
||||
BlockSize = 64
|
||||
)
|
||||
// Size of a SHA-1 checksum in bytes.
|
||||
const Size = 20
|
||||
|
||||
// BlockSize is the block size of SHA-1 in bytes.
|
||||
const BlockSize = 64
|
||||
|
||||
// Sum returns the SHA-1 checksum of data.
|
||||
func Sum(data []byte) [Size]byte {
|
||||
n := len(data)
|
||||
h := [5]uint32{0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0}
|
||||
@@ -21,7 +23,7 @@ func Sum(data []byte) [Size]byte {
|
||||
|
||||
// Final block.
|
||||
tmp := make([]byte, BlockSize)
|
||||
copy(tmp[:], data)
|
||||
copy(tmp, data)
|
||||
tmp[len(data)] = 0x80
|
||||
|
||||
if len(data) >= 56 {
|
||||
|
||||
Reference in New Issue
Block a user