From a7e0ab8a331a548c7e321856f07f85ebfd7a0e8a Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Fri, 9 Jul 2021 23:19:01 +0200 Subject: reduce: use a base64 encoded title as key --- skate/reduce.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'skate') diff --git a/skate/reduce.go b/skate/reduce.go index 9babbae..5a2594d 100644 --- a/skate/reduce.go +++ b/skate/reduce.go @@ -18,6 +18,7 @@ package skate import ( + "encoding/base64" "fmt" "io" "log" @@ -161,7 +162,12 @@ func ZippyExactWiki(releases, wiki io.Reader, mr MatchResult, w io.Writer) error return err } var bref BiblioRef - bref.Key = fmt.Sprintf("%s_%s", slugifyString(wiki.PageTitle), target.Ident) // XXX: what should we use? + // 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)), + target.Ident) + bref.Key = key bref.SourceWikipediaArticle = wiki.PageTitle bref.TargetReleaseIdent = target.Ident bref.TargetWorkIdent = target.WorkID -- cgit v1.2.3