1

I want to convert my hexadecimal string to byte literal in javascript

bytes.fromhex(get_hex_coded_ascii(payload_size + payload + str(crc)) this code is in python but I want to change this into javascipt

  • Welcome to [so]. Please take a [tour] of the site, read [ask] a good question and how to create a [mcve]. Then come back to your question and reformulate it (preferably with code samples, the provided input and the expected output) in order to get a (useful) answer. Before posting a question, [search](/search) the site and make sure a similar question wasn't already answered. Show what you have tried and where you got stuck to maximize the chances to get help. The Python code does not help. Add a sample input and the expected output instead. – axiac Apr 04 '22 at 13:06
  • https://stackoverflow.com/questions/14603205/how-to-convert-hex-string-into-a-bytes-array-and-a-bytes-array-in-the-hex-strin – Diego D Apr 04 '22 at 13:35
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Apr 04 '22 at 21:01
  • This is already a duplicate to an old post. Here's the most upvoted answer https://stackoverflow.com/a/34356351/2678218 – Alex Pappas May 05 '22 at 07:21
  • Does this answer your question? [How to convert hex string into a bytes array, and a bytes array in the hex string?](https://stackoverflow.com/questions/14603205/how-to-convert-hex-string-into-a-bytes-array-and-a-bytes-array-in-the-hex-strin) – Alex Pappas May 05 '22 at 07:21

0 Answers0