NewReaderWithPassword returns a new [*Reader] reading from r using password as the basis of the decryption key, which is assumed to have the given size in bytes.
(r io.ReaderAt, size int64, password string)
| 289 | // as the basis of the decryption key, which is assumed to have the given size |
| 290 | // in bytes. |
| 291 | func NewReaderWithPassword(r io.ReaderAt, size int64, password string) (*Reader, error) { |
| 292 | if size < 0 { |
| 293 | return nil, errNegativeSize |
| 294 | } |
| 295 | |
| 296 | zr := new(Reader) |
| 297 | zr.p = password |
| 298 | |
| 299 | if err := zr.init(r, size); err != nil { |
| 300 | return nil, err |
| 301 | } |
| 302 | |
| 303 | return zr, nil |
| 304 | } |
| 305 | |
| 306 | // NewReader returns a new [*Reader] reading from r, which is assumed to have |
| 307 | // the given size in bytes. |
searching dependent graphs…