How to create sha1 checksums of files inside a tar archive without using much disk space

Too easy :

tar xvJf myArchive.tar.xz --to-command=sha1sum

The result is like this :

z/
z/DOCUMENTATION
3c4d9df9bcbd1fb756b1aaba8dd6a2db788a8659 *-
z/getnameenv.sh
1b7f1ef4bbb229e4dc5d280c3c9835d9d061726a *-

Or create "tarsha1.sh" with :

#!/bin/bash

sha1=`sha1sum`
echo -n $sha1 | sed 's/ .*$//'
echo " $TAR_FILENAME"

Then use it this way :

tar xJf myArchive.tar.xz --to-command=./tarsha1.sh

The result is like this :

3c4d9df9bcbd1fb756b1aaba8dd6a2db788a8659 z/DOCUMENTATION
1b7f1ef4bbb229e4dc5d280c3c9835d9d061726a z/getnameenv.sh