現有一段python代碼,因要在C#中使用,不會python,求助給轉成C#或給解釋下代碼的意思
class KeyBlock:
key: bytes = None
@staticmethod
def new_block(login: str = ""):
if len(login) > 30:
raise Exception("無效引數")
result = KeyBlock()
temp = login + "0123456789ABCDEF"
S = struct.pack("<I", len(temp))
for i in range(60 - len(temp)):
temp += "\x01"
result.key = bytes(temp.encode() + S )
return result
def get_result(self) -> bytes:
return self.key
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/277250.html
標籤:C#
