Browse Source

perf: 优化去除结尾空字节的写法

pull/8908/head
Aaron3S 2 years ago committed by Jiangjie.Bai
parent
commit
1bc6e50b06
  1. 2
      apps/common/utils/crypto.py

2
apps/common/utils/crypto.py

@ -83,7 +83,7 @@ class PiicoSM4EcbCrypto(BaseCrypto):
def _decrypt(self, data: bytes) -> bytes:
bs = self.cipher.decrypt(data)
return bs[:bs.index(0)]
return bs.rstrip(b'\0')
class AESCrypto:

Loading…
Cancel
Save