Convert Appian Document to Base64

We have requirement to convert Appian document to Base64 string and pass it as a parameter in the JSON to a Integration call.

Could someone suggest a best way to do this with any plugins?

Appian version we use : 18.2

  Discussion posts and replies are publicly visible