MCPcopy Create free account
hub / github.com/bodgit/sevenzip / NewReaderWithPassword

Function NewReaderWithPassword

reader.go:291–304  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

289// as the basis of the decryption key, which is assumed to have the given size
290// in bytes.
291func 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.

Callers 2

NewReaderFunction · 0.85

Calls 1

initMethod · 0.80

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…