Convert Char Array to byte Array

Hello,

Hopefully a simple question for one of you guys. I have a char array:
const byte tempChars = 45;
char temP[tempChars];

This array holds null terminated array of hex characters eg;

temP [A, B, C, D, E, F, \0]

Problem #1
What I would like to do is convert that array into a byte array with [0] and [1] as a byte [2] and [3] as a byte etc.:

bytearray [ AB, CD, EF]

Problem #2
If there is an odd number of hex characters, I would like to have a 0 added if needed to the last hex value:

temP[ A, B, C, \0]

bytearray[ AB, C0]

I would appreciate any help