(word []byte)
| 255 | } |
| 256 | |
| 257 | func (buf *Buffer) EncodeWordBytes32Inv(word []byte) ([]byte, EncodeType, error) { |
| 258 | if len(word) > 32 { |
| 259 | return nil, Stateless, fmt.Errorf("word exceeds 32 bytes") |
| 260 | } |
| 261 | |
| 262 | if len(word) == 0 { |
| 263 | return nil, Stateless, fmt.Errorf("word is empty") |
| 264 | } |
| 265 | |
| 266 | if !buf.Allows(FLAG_READ_WORD_INV) { |
| 267 | return nil, Stateless, fmt.Errorf("bytes32 INV encoding is not allowed") |
| 268 | } |
| 269 | |
| 270 | encodedWord := []byte{byte(FLAG_READ_WORD_INV), byte(FLAG_READ_WORD_1 + uint(len(word)) - 1)} |
| 271 | encodedWord = append(encodedWord, word...) |
| 272 | return encodedWord, Stateless, nil |
| 273 | } |
| 274 | |
| 275 | // Encodes N words |
| 276 | func (buf *Buffer) WriteNWords(words []byte) (EncodeType, error) { |
no test coverage detected