README | 4 ++-- src/uploader/main.go | 6 +++--- diff --git a/README b/README index 912997137379f897d1f7abfa415318840bc7979f..823492a49f8895b01a55c1ec6d3b0b1b2b8fad4b 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ Simplest form file uploader. It just saves uploaded file from HTML form to the new file on the disk. -Also it calculates BLAKE2s checksum, replying with it in the answer. +Also it calculates BLAKE2b checksum, replying with it in the answer. You can upload files with curl: @@ -8,4 +8,4 @@ curl -F fileupload=@somedata.tar.gpg http://localhost:8086/upload/ You can verify integrity locally: - b2sum -a blake2s somedata.tar.gpg + b2sum -a blake2b somedata.tar.gpg diff --git a/src/uploader/main.go b/src/uploader/main.go index c3f4e23f44044b5f9d4792a12837389eda19511b..e2154cdc57df52e83648cc9a4fb5cbca0dabe083 100644 --- a/src/uploader/main.go +++ b/src/uploader/main.go @@ -18,7 +18,7 @@ "net/http" "os" "time" - "golang.org/x/crypto/blake2s" + "golang.org/x/crypto/blake2b" "golang.org/x/net/netutil" ) @@ -57,7 +57,7 @@ if p.FormName() != FileFieldName { log.Println(r.RemoteAddr, "non file form field") return } - h, err := blake2s.New256(nil) + h, err := blake2b.New256(nil) if err != nil { panic(err) } @@ -86,7 +86,7 @@ if err = os.Rename(fn+".part", fn); err != nil { log.Println(r.RemoteAddr, fn, p.FileName(), n, sum, err) return } - fmt.Fprintf(w, "bytes: %d\nBLAKE2s: %s\n", n, sum) + fmt.Fprintf(w, "Timestamp: %s\nBytes: %d\nBLAKE2b: %s\n", fn, n, sum) log.Println(r.RemoteAddr, fn, p.FileName(), n, sum) }