Hex isn't complicated: it's the same a base 10 that you normally use, but based on 16 instead.
So to convert string values from decimal to hex is pretty easy:
1) Extract the numeric data from the string:
"1209", "678", "4", "3"
You know how to do that, you said so.
2) Convert those to integer values:
1209, 678, 4, 3
That's not complex either:
atoi - C++ Reference[
^]
3) Convert each integer to hex. That's also pretty easy, particularly with leading zeros:
3.1) Shift the top hex digit to the bottom position - the >> operator will do that if you use multiples of 4 for the shift count.
3.2) Use a binary AND to mask the value to just the lower four bits: that is a single hex digit.
3.3) Convert the hex digit to ASCII:
0 - '0'
1 - '1'
...
9 - '9'
10 - 'A'
11 - 'B'
...
15 - 'F'
3.4) Shift the original value left 4 places ready for the next digit - the << operator is your friend here.
4) Repeat until you have all digits.
Negatives convert automatically to hex values with the top bit set.
Give it a try manually, and you'll see what I mean.