X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=main.go;h=f97f4df68647fcd4ce7b5a18a17d997577b2a86a;hb=9524936cc784559ef7a6628070f6002d295af13a;hp=00b396e4ba9c4450ed3ba3d7518c495e9b363c12;hpb=051552265345ad165bd015fabc8b7c947809e708;p=uploader.git diff --git a/main.go b/main.go index 00b396e..f97f4df 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,6 @@ /* uploader -- simplest form file uploader -Copyright (C) 2018-2020 Sergey Matveev +Copyright (C) 2018-2021 Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ import ( "time" "go.cypherpunks.ru/recfile" - "go.cypherpunks.ru/tai64n" + "go.cypherpunks.ru/tai64n/v2" "golang.org/x/crypto/blake2b" "golang.org/x/net/netutil" ) @@ -130,8 +130,8 @@ func upload(w http.ResponseWriter, r *http.Request) { } t := time.Now() ts := new(tai64n.TAI64N) - tai64n.FromTime(t, ts) - tai := ts.Encode()[1:] + ts.FromTime(t) + tai := tai64n.Encode(ts[:])[1:] fnOrig := p.FileName() fd, err := os.OpenFile(tai+".part", os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0666) if err != nil {