How to identify a Base64-encoded string

In my current project I’ve created a Web Service-consumer in NAV that maps payload-data flexible using the Data Exchange Definition. Unfortunately in REST- and SOAP-payloads, binary information (JPG, PDF etc.)  is delivered as a string. So, I’ve got a little task to find a way to differ between a string (like an address line) and binary information.