diff options
Diffstat (limited to 'skate/reduce.go')
-rw-r--r-- | skate/reduce.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/skate/reduce.go b/skate/reduce.go index 5a2594d..cd63bb1 100644 --- a/skate/reduce.go +++ b/skate/reduce.go @@ -18,7 +18,7 @@ package skate import ( - "encoding/base64" + "encoding/base32" "fmt" "io" "log" @@ -144,6 +144,7 @@ func ZippyExactReleases(olr, releases io.Reader, matchResult MatchResult, w io.W func ZippyExactWiki(releases, wiki io.Reader, mr MatchResult, w io.Writer) error { var ( enc = json.NewEncoder(xio.NewSingleWriter(w)) + b32enc = base32.StdEncoding.WithPadding(base32.NoPadding) keyer = makeKeyFunc("\t", 1) grouper = func(g *zipkey.Group) error { var ( @@ -165,7 +166,7 @@ func ZippyExactWiki(releases, wiki io.Reader, mr MatchResult, w io.Writer) error // We use base64 w/o padding of the original PageTitle as // component for the id. XXX: ok for now? key := fmt.Sprintf("%s_%s", - base64.RawURLEncoding.EncodeToString([]byte(wiki.PageTitle)), + strings.ToLower(b32enc.EncodeToString([]byte(wiki.PageTitle))), target.Ident) bref.Key = key bref.SourceWikipediaArticle = wiki.PageTitle |