We have found an issue in version 5.2 To reproduce it
``` $var(x) = "wg48D8NPIJ5JEfkgqhuu+Q=="; $var(decode64) = $(var(x){s.decode.base64}); $var(encode16) = $(var(decode64){s.encode.hexa}); ```
after these line the value of encode16 must be 'c20e3c0fc34f209e4911f920aa1baef9'
Looking inside the module pv, file pv_trans.c, line 347, we realized that the code is not correct because the shift operation keeps the sign,
`_tr_buffer[j++] = fourbits2char[val->rs.s[i] >> 4];`
we saw that if we modifies the previous line with the following
`_tr_buffer[j++] = fourbits2char[(unsigned char)(val->rs.s[i]) >> 4];`
the function works as expected
What are your CPU architecture, operating system and compiler?
Commits were pushed for this issue, still willing to know about the CPU, OS and compiler because the right shifting is platform specific when comes to signed numbers. The code was mainly targeting ASCII encoding/deconding (positive bytes), characters in the sip message, but it is better to support every case.
Closed #2690.