Home > Net >  Turn a python code into c #
Turn a python code into c #

Time:04-18

Existing a python code, due to be used in c #, not python, help to into c # or to explain the meaning of the code
The class KeyBlock:
Key: bytes=None

@ staticmethod
Def new_block (login: STR="") :
If len (login) & gt; 30:
Raise the Exception (" invalid parameter ")
Result=KeyBlock ()
Temp=login + 0123456789 "abcdef"
S=struct. Pack (" & lt; I, "len (temp))

For I in range (60 - len (temp)) :
Temp +="\ x01
"Result. The key=bytes (temp. Encode () + S)
Return the result
Def get_result (self) - & gt; Bytes:
Return the self. The key
  •  Tags:  
  • C#
  • Related