From: Sergey Matveev Date: Tue, 26 Mar 2024 08:39:57 +0000 (+0300) Subject: More compact Base64 ETag X-Git-Tag: v0.34.0^0 X-Git-Url: http://www.git.stargrave.org/?p=sgblog.git;a=commitdiff_plain;h=HEAD More compact Base64 ETag --- diff --git a/cmd/sgblog/http.go b/cmd/sgblog/http.go index 2e0c2d8..000037a 100644 --- a/cmd/sgblog/http.go +++ b/cmd/sgblog/http.go @@ -19,7 +19,7 @@ import ( "bytes" "crypto/sha1" _ "embed" - "encoding/hex" + "encoding/base64" "encoding/xml" "errors" "fmt" @@ -98,7 +98,7 @@ func makeA(href, text string) string { } func etagString(etag hash.Hash) string { - return `"` + hex.EncodeToString(etag.Sum(nil)) + `"` + return `"` + base64.RawURLEncoding.EncodeToString(etag.Sum(nil)) + `"` } func urlParse(what string) *url.URL { diff --git a/common.go b/common.go index 41ba4c3..e7ac217 100644 --- a/common.go +++ b/common.go @@ -30,7 +30,7 @@ import ( ) const ( - Version = "0.33.0" + Version = "0.34.0" WhenFmt = "2006-01-02 15:04:05Z07:00" )