mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-26 15:01:59 +00:00
perf: 优化去除结尾空字节的写法
This commit is contained in:
parent
1d3135d2d7
commit
1bc6e50b06
@ -83,7 +83,7 @@ class PiicoSM4EcbCrypto(BaseCrypto):
|
|||||||
|
|
||||||
def _decrypt(self, data: bytes) -> bytes:
|
def _decrypt(self, data: bytes) -> bytes:
|
||||||
bs = self.cipher.decrypt(data)
|
bs = self.cipher.decrypt(data)
|
||||||
return bs[:bs.index(0)]
|
return bs.rstrip(b'\0')
|
||||||
|
|
||||||
|
|
||||||
class AESCrypto:
|
class AESCrypto:
|
||||||
|
Loading…
Reference in New Issue
Block a user