Skip to content

Commit a9a710a

Browse files
committed
Fix current time as iterator
1 parent 6a64150 commit a9a710a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/src/main/kotlin/one/mixin/bot/Session.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fun signToken(userId: String, sessionId: String, request: Request, key: Key): St
4848
return signToken(userId, sessionId, request.method, request.url.path(), body, key)
4949
}
5050

51-
fun encryptPin(key: String, pin: String, iterator: Long = System.nanoTime()): String {
51+
fun encryptPin(key: String, pin: String, iterator: Long = System.currentTimeMillis() * 1_000_000): String {
5252
val pinByte = pin.toByteArray() + (System.currentTimeMillis() / 1000).toLeByteArray() + iterator.toLeByteArray()
5353
return aesEncrypt(key.base64Decode(), pinByte).base64Encode()
5454
}

0 commit comments

Comments
 (0)