File tree 1 file changed +7
-0
lines changed 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -240,6 +240,13 @@ func (ba *BitArray) BitAt(off int) byte {
240
240
// single byte 0xf0. In order to prevent these from being mapped to the same
241
241
// hash value, the hash is calculated after appending a 3 bits marker
242
242
// indicating the number of padding LSBs at the end of the original bit array.
243
+ //
244
+ // Deprecated: Most hash functions can handle bit-oriented messages as-is by
245
+ // design, and it is not appropriate to use the byte-oriented standard hash.Hash
246
+ // with padding bits. The result does not comply with the specifications. Not
247
+ // all hash functions are available, but for SHA-1 and SHA-2, which can handle
248
+ // bit-oriented messages correctly, dedicated methods such as SHA512, SHA256,
249
+ // and SHA1 are now available. It is better to use them instead.
243
250
func (ba * BitArray ) Hash (h hash.Hash ) []byte {
244
251
b , _ := ba .MarshalBinary ()
245
252
h .Write (b )
You can’t perform that action at this time.
0 commit comments