From a43d46ba57875e3cc3d841349cf7924f09d893c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=91=E8=B4=A8?= Date: Mon, 13 Mar 2023 16:01:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3GenIMEI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/global.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/global.go b/client/global.go index 9ce718e7..f0ab8998 100644 --- a/client/global.go +++ b/client/global.go @@ -92,14 +92,14 @@ func GenIMEI() string { randGen := rand.New(rand.NewSource(time.Now().UnixNano())) for i := 0; i < 14; i++ { // generating all the base digits toAdd := randGen.Intn(10) + fmt.Fprintf(&final, "%d", toAdd) // printing them here! if (i+1)%2 == 0 { // special proc for every 2nd one toAdd *= 2 if toAdd >= 10 { toAdd = (toAdd % 10) + 1 } } - sum += toAdd - fmt.Fprintf(&final, "%d", toAdd) // and even printing them here! + sum += toAdd // and even add them here! } ctrlDigit := (sum * 9) % 10 // calculating the control digit fmt.Fprintf(&final, "%d", ctrlDigit)