dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 516889d01b20460b94a3ef3d592d7f9048956526
parent 81feeb97018e51e4338e77da39c1138674ef43e3
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Wed,  9 Nov 2022 23:19:09 -0800

simplify code

Diffstat:
Mpkg/captcha/captcha.go | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pkg/captcha/captcha.go b/pkg/captcha/captcha.go @@ -107,11 +107,11 @@ func New() (string, string) { return newLen(Params{}) } -func NewWithParams(params Params) (id string, b64 string) { +func NewWithParams(params Params) (id, b64 string) { return newLen(params) } -func newLen(params Params) (id string, b64 string) { +func newLen(params Params) (id, b64 string) { r := rnd s := globalStore if params.Store != nil { @@ -185,15 +185,15 @@ func verify(store Store, id string, digits []byte, clear bool) error { // VerifyString is like Verify, but accepts a string of digits. It removes // spaces and commas from the string, but any other characters, apart from // digits and listed above, will cause the function to return false. -func VerifyString(id string, digits string) error { +func VerifyString(id, digits string) error { return verifyString(globalStore, id, digits, true) } -func VerifyStringDangerous(store Store, id string, digits string) error { +func VerifyStringDangerous(store Store, id, digits string) error { return verifyString(store, id, digits, false) } -func verifyString(store Store, id string, digits string, clear bool) error { +func verifyString(store Store, id, digits string, clear bool) error { if digits == "" { return ErrInvalidCaptcha }