@stdlib/string-base-atob
v0.1.1
Published
Decode a string of data which has been encoded using Base64 encoding.
Readme
atob
Decode a string of data which has been encoded using Base64 encoding.
Installation
npm install @stdlib/string-base-atobUsage
var atob = require( '@stdlib/string-base-atob' );atob( str )
Decodes a string of data which has been encoded using Base64 encoding.
var out = atob( 'SGVsbG8sIHdvcmxk' );
// returns 'Hello, world'Notes
- This function differs from the global
atobavailable in web browsers and more recent Node.js versions in that the function returnsnullwhen provided a string containing non-ASCII characters, rather than raising an exception.
Examples
var atob = require( '@stdlib/string-base-atob' );
var str = 'SGVsbG8gV29ybGQh';
var out = atob( str );
// returns 'Hello World!'
str = 'SEVMTE8gV09STEQh';
out = atob( str );
// returns 'HELLO WORLD!'
str = 'VG8gYmUsIG9yIG5vdCB0byBiZTogdGhhdCBpcyB0aGUgcXVlc3Rpb24u';
out = atob( str );
// returns 'To be, or not to be: that is the question.'Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2026. The Stdlib Authors.
