"go.cypherpunks.ru/recfile"
"go.cypherpunks.ru/tai64n/v2"
- "golang.org/x/crypto/blake2b"
"golang.org/x/net/netutil"
+ "lukechampine.com/blake3"
)
const (
Example command line usage:
<pre>
$ curl -F file=@somedata.tar.gpg [-F comment="optional comment"] http://.../upload/
-$ b2sum somedata.tar.gpg # to verify BLAKE2b-512 checksum
+$ b3sum somedata.tar.gpg # to verify BLAKE3-256 checksum
</pre>
<form enctype="multipart/form-data" action="/upload/" method="post">
<label for="file">File to upload:</label><br/>
log.Println(r.RemoteAddr, "non file form field")
return
}
- h, err := blake2b.New512(nil)
- if err != nil {
- panic(err)
- }
t := time.Now()
ts := new(tai64n.TAI64N)
ts.FromTime(t)
return
}
fdBuf := bufio.NewWriterSize(fd, WriteBufSize)
+ h := blake3.New(32, nil)
mw := io.MultiWriter(fdBuf, h)
n, err := io.Copy(mw, p)
if err != nil {