js代码改写py
This commit is contained in:
11
m2pool_backend_app/public/endian.py
Normal file
11
m2pool_backend_app/public/endian.py
Normal file
@@ -0,0 +1,11 @@
|
||||
def change_endian(hex_str: str) -> str:
|
||||
# Convert hex string to bytes
|
||||
buffer = bytes.fromhex(hex_str)
|
||||
# Reverse the byte order
|
||||
endian = buffer[::-1]
|
||||
# Convert back to hex string
|
||||
result = endian.hex()
|
||||
return result
|
||||
|
||||
|
||||
__all__ = ["change_endian"]
|
||||
Reference in New Issue
Block a user