structure saas with tools

This commit is contained in:
Davidson Gomes
2025-04-25 15:30:54 -03:00
commit 1aef473937
16434 changed files with 6584257 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
import binascii
def encode_int(num, bits):
length = ((bits + 7) // 8) * 2
padded_hex = f"{num:0{length}x}"
big_endian = binascii.a2b_hex(padded_hex.encode("ascii"))
return big_endian
def decode_int(b):
return int(binascii.b2a_hex(b), 16)