Skip to content

Commit

Permalink
Make ErrHashStrSize slightly more descriptive.
Browse files Browse the repository at this point in the history
Add the word 'string' to the error string so if this is printed, it
will be clearer that it was a hash string decode that failed (as
opposed to other errors creating a ShaHash from a byte slice) and
change 'chars' to 'bytes', since the string length is measured in
bytes, not UTF-8 code points.

ok @davecgh
  • Loading branch information
jrick committed Sep 12, 2014
1 parent 225248d commit 0127b3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shahash.go
Expand Up @@ -18,7 +18,7 @@ const MaxHashStringSize = HashSize * 2

// ErrHashStrSize describes an error that indicates the caller specified a hash
// string that has too many characters.
var ErrHashStrSize = fmt.Errorf("max hash length is %v chars", MaxHashStringSize)
var ErrHashStrSize = fmt.Errorf("max hash string length is %v bytes", MaxHashStringSize)

// ShaHash is used in several of the bitcoin messages and common structures. It
// typically represents the double sha256 of data.
Expand Down

0 comments on commit 0127b3a

Please sign in to comment.