Skip to content

Commit

Permalink
VTT-4934 btoa issue (#245)
Browse files Browse the repository at this point in the history
Co-authored-by: stephen jones <stephen.jones@alertlogic.com>
  • Loading branch information
sjgjones and stephen jones authored Nov 14, 2022
1 parent b89957c commit 0ea0bc8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@al/core",
"version": "1.0.194",
"version": "1.0.195",
"description": "Node Enterprise Packages for Alert Logic (NEPAL) Core Library",
"main": "./dist/index.cjs.js",
"types": "./dist/index.d.ts",
Expand Down
5 changes: 1 addition & 4 deletions src/client/al-api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,9 @@ export class AlApiClient implements AlValidationSchemaProvider
}

/**
* Converts a string input to its base64 encoded equivalent. Uses browser-provided btoa if available, or 3rd party btoa module as a fallback.
* Converts a string input to its base64 encoded equivalent.
*/
public base64Encode( data:string ):string {
if ( this.isBrowserBased() && window.btoa ) {
return btoa( data );
}
let utf8Data = unescape( encodeURIComponent( data ) ); // forces conversion to utf8 from utf16, because... not sure why
let bytes = [];
for ( let i = 0; i < utf8Data.length; i++ ) {
Expand Down

0 comments on commit 0ea0bc8

Please sign in to comment.