Skip to content

Commit 3d56ad3

Browse files
Adding atob and btoa
Adding description and example of atob and btoa
1 parent cf92246 commit 3d56ad3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

articles/stream-analytics/stream-analytics-javascript-user-defined-functions.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,16 @@ console.log('my error message');
218218
```
219219

220220
You can access log messages through the [diagnostic logs](data-errors.md).
221+
222+
## atob() and btoa()
223+
The method btoa() can be used to encode an ASCII string into Base64. This is usually done to transfer data in a binary format. The atob() method can be used to decode a string of data encoded in Base64 to an ASCII string format.
224+
225+
```javascript
226+
var myAsciiString = 'ascii string';
227+
var encodedString = btoa(myAsciiString);
228+
var decodedString = atob(encodedString);
229+
```
230+
221231
## Next steps
222232

223233
* [Machine Learning UDF](./machine-learning-udf.md)

0 commit comments

Comments
 (0)