3 added 2 characters in body
source | link

Python, 182187 178 bytes

a='?0123456789abcdef'
def g(x):w,z=map(a'?0123456789abcdef'.index,x);d=w-z;return min(d,d+17*(d<=0 or -1),key=abs)*21
def f(s):s=''.join(map('{:2x}'.format,s.encode()));return[*map(g,zip(s+'?','?'+s))]

Test cases

for k in ['STATUS', 'NO', 'CROPS?', 'DDD', 'Hello world!']:
    print('Input:  {}\nOutput: {}'.format(k, f(k)))

Python, 182 bytes

a='?0123456789abcdef'
def g(x):w,z=map(a.index,x);d=w-z;return min(d,d+17*(d<=0 or -1),key=abs)*21
def f(s):s=''.join(map('{:2x}'.format,s.encode()));return[*map(g,zip(s+'?','?'+s))]

Test cases

for k in ['STATUS', 'NO', 'CROPS?', 'DDD', 'Hello world!']:
    print('Input:  {}\nOutput: {}'.format(k, f(k)))

Python, 187 178 bytes

def g(x):w,z=map('?0123456789abcdef'.index,x);d=w-z;return min(d,d+17*(d<=0 or -1),key=abs)*21
def f(s):s=''.join(map('{:2x}'.format,s.encode()));return[*map(g,zip(s+'?','?'+s))]

Test cases

for k in ['STATUS', 'NO', 'CROPS?', 'DDD', 'Hello world!']:
    print('Input:  {}\nOutput: {}'.format(k, f(k)))
2 added 16 characters in body
source | link

Python, 182 bytes

a='?0123456789abcdef'
def g(x):w,z=map(a.index,x);d=w-z;return min(d,d+17*(d<=0 or -1),key=abs)*21
def f(s):s=''.join(map('{:2x}'.format,s.encode()));return[*map(g,zip(s+'?','?'+s))]

Test cases

for k in ['STATUS', 'NO', 'CROPS?', 'DDD', 'Hello world!']:
    print(''Input:  {}\n\nOutput: {}'.format(k, f(k)))

Python, 182 bytes

a='?0123456789abcdef'
def g(x):w,z=map(a.index,x);d=w-z;return min(d,d+17*(d<=0 or -1),key=abs)*21
def f(s):s=''.join(map('{:2x}'.format,s.encode()));return[*map(g,zip(s+'?','?'+s))]

Test cases

for k in ['STATUS', 'NO', 'CROPS?', 'DDD', 'Hello world!']:
    print('{}\n{}'.format(k, f(k)))

Python, 182 bytes

a='?0123456789abcdef'
def g(x):w,z=map(a.index,x);d=w-z;return min(d,d+17*(d<=0 or -1),key=abs)*21
def f(s):s=''.join(map('{:2x}'.format,s.encode()));return[*map(g,zip(s+'?','?'+s))]

Test cases

for k in ['STATUS', 'NO', 'CROPS?', 'DDD', 'Hello world!']:
    print('Input:  {}\nOutput: {}'.format(k, f(k)))
1
source | link

Python, 182 bytes

a='?0123456789abcdef'
def g(x):w,z=map(a.index,x);d=w-z;return min(d,d+17*(d<=0 or -1),key=abs)*21
def f(s):s=''.join(map('{:2x}'.format,s.encode()));return[*map(g,zip(s+'?','?'+s))]

Test cases

for k in ['STATUS', 'NO', 'CROPS?', 'DDD', 'Hello world!']:
    print('{}\n{}'.format(k, f(k)))