use of com.adaptris.util.text.HexStringByteTranslator in project interlok by adaptris.
the class HexToStringService method reformat.
@Override
public String reformat(String s, String msgCharset) throws Exception {
ByteTranslator hexToBytes = new HexStringByteTranslator();
ByteTranslator bytesToString = new CharsetByteTranslator(getCharacterEncoding());
return bytesToString.translate(hexToBytes.translate(s));
}
use of com.adaptris.util.text.HexStringByteTranslator in project interlok by adaptris.
the class MetadataHashingTest method testService_KnownHash.
@Test
public void testService_KnownHash() throws Exception {
MetadataHashingService service = new MetadataHashingService(METADATA_KEY, "MD5", new HexStringByteTranslator());
AdaptrisMessage msg = createMessage(null);
execute(service, msg);
assertEquals(METADATA_HASH_MD5, msg.getMetadataValue(METADATA_KEY));
}
Aggregations