1
二進制數據,如果我已經解包的二進制數據包裝在JavaScript
1700885369 # translates to 'easy'
我怎樣才能回到一個字節數組(最好是沒有進口任何物件)?像Python的struct.Struct(format).pack
:
>>> import struct
>>> s = struct.Struct('>1I') # a big-endian, two-byte, unsigned int
>>> s.pack(1700885369)
b'easy' # bytearray([101, 97, 115, 121])