Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

184
Views
How to convert a string to byte array for javascript

How can I convert a string in bytearray using JavaScript. Output should be equivalent of the below Python code.

string2 = '68 03 01 00 22 aa 04 9e 04 4a c2 01 4a 3c 4a c2 01 4a 3c 4a 3c 4a 3c 4a 3c 4a c2 01 4a c2 01 4a 3c 4a 3c 4a c2 01 4a 3c 4a 3c 4a 3c 4a 3c 4a 3c 4a c2 01 4a 3c 4a 3c 4a 3c 4a 3c 4a 3c 49 c2 01 49 c2 01 49 c2 01 4a c2 01 49 c2 01 4a c2 01 4a c2 01 49 c2 01 4a c2 01 4a c2 01 4a c2 01 4a c2 01 4a c2 01 4a c2 01 4a c2 01 4a c2 01 4a c2 01 4a 3c 4a c2 01 4a 3c 4a 3c 4a c2 01 4a c2 01 49 c2 01 4a c2 01 4a 84 05 ab 04 9e 04 4a 3c 49 c3 01 47 3f 47 c5 01 47 c5 01 4a c2 01 4d bf 01 49 3d 48 3d 46 c6 01 44 c8 01 44 42 44 c8 01 47 c5 01 47 c5 01 47 c5 01 47 c5 01 46 3f 46 c6 01 46 c6 01 46 c6 01 46 c6 01 46 c6 01 46 3f 46 30 46 40 46 40 46 40 46 40 46 40 46 40 45 40 46 40 45 40 45 40 45 40 45 43 42 43 42 43 42 43 42 ca 01 42 44 42 ca 01 41 cb 01 41 44 41 44 41 44 41 44 41 45 16'
    
    
data1 = bytearray.fromhex(string2)
for data in data1:
                hex_byte = ("{0:02x}".format(data))
                #print (hex_byte)
                hex_byte = bytearray.fromhex(hex_byte)
                #print (hex_byte)
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!