1
0
forked from um/cli

fix(QMCv2): unlock error on 32bit platform

This commit is contained in:
MengYX 2022-01-09 06:24:58 +08:00
parent 42d658625f
commit 76df8e6c1a
No known key found for this signature in database
GPG Key ID: E63F9C7303E8F604

View File

@ -119,6 +119,6 @@ func (c *rc4Cipher) encASegment(buf []byte, offset int) {
} }
func (c *rc4Cipher) getSegmentSkip(id int) int { func (c *rc4Cipher) getSegmentSkip(id int) int {
seed := int(c.key[id%c.n]) seed := int(c.key[id%c.n])
idx := int(float64(c.hash) / float64((id+1)*seed) * 100.0) idx := int64(float64(c.hash) / float64((id+1)*seed) * 100.0)
return idx % c.n return int(idx % int64(c.n))
} }