From 76df8e6c1a006b0cdd7a66b4de294ee16585791e Mon Sep 17 00:00:00 2001 From: MengYX Date: Sun, 9 Jan 2022 06:24:58 +0800 Subject: [PATCH] fix(QMCv2): unlock error on 32bit platform --- algo/qmc/cipher_rc4.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/algo/qmc/cipher_rc4.go b/algo/qmc/cipher_rc4.go index 4485076..791d6da 100644 --- a/algo/qmc/cipher_rc4.go +++ b/algo/qmc/cipher_rc4.go @@ -119,6 +119,6 @@ func (c *rc4Cipher) encASegment(buf []byte, offset int) { } func (c *rc4Cipher) getSegmentSkip(id int) int { seed := int(c.key[id%c.n]) - idx := int(float64(c.hash) / float64((id+1)*seed) * 100.0) - return idx % c.n + idx := int64(float64(c.hash) / float64((id+1)*seed) * 100.0) + return int(idx % int64(c.n)) }