From 87e8b5c5a8c9cb2d79d3d91188203f34414a4d61 Mon Sep 17 00:00:00 2001 From: Wondertan Date: Sun, 16 Apr 2023 13:52:28 +0200 Subject: [PATCH] feat(verifcid): AddGoodHash Allows Boxo users to expand the set of secure hash functions without having to fork Boxo. --- verifcid/validate.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/verifcid/validate.go b/verifcid/validate.go index 7b27debc9..200f9115f 100644 --- a/verifcid/validate.go +++ b/verifcid/validate.go @@ -33,6 +33,13 @@ var goodset = map[uint64]bool{ mh.SHA1: true, // not really secure but still useful } +func AddGoodHash(code uint64) { + good, found := goodset[code] + if !found || !good { + goodset[code] = true + } +} + func IsGoodHash(code uint64) bool { good, found := goodset[code] if good {