]> Sergey Matveev's repositories - btrtrc.git/commit
Allow Storage Backends to do their own Hashing (#518)
authorZilog8 <zeuscoding@gmail.com>
Tue, 8 Jun 2021 05:45:35 +0000 (01:45 -0400)
committerGitHub <noreply@github.com>
Tue, 8 Jun 2021 05:45:35 +0000 (15:45 +1000)
commite2a559e2435a0629164f69142274c9a131afc24b
tree66a0bcc70b3b6521f5fdb58cef50c2108ac6355d
parenta68f040ea6785461e83a5b7b45366fcbbf3a3078
Allow Storage Backends to do their own Hashing (#518)

* Allow Storage Backends to do their own Hashing

- Describes an optional interface 'SelfHashing' that a storage backend's type implementing 'PieceImpl' may also implement in order to calculate piece hashsums itself.

- Alters the 'hashPiece' function in the torrent package to look for types implementing 'SelfHashing' . If not implemented, calculate the hash as usual.
storage/interface.go
torrent.go