Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
SCSocket.prototype.decodeBase64 = function (encodedString) {
var decodedString;
if (typeof Buffer == 'undefined') {
if (global.atob) {
decodedString = global.atob(encodedString);
} else {
decodedString = base64.decode(encodedString);
}
} else {
var buffer = new Buffer(encodedString, 'base64');
decodedString = buffer.toString('utf8');
}
return decodedString;
};