Menu

gitpiper

btoa javascript Code Snippet in 2024

nodestringbeginner

Last Updated: 18 December 2024

Creates a base-64 encoded ASCII string from a String object in which each character in the string is treated as a byte of binary data.

  • Create a Buffer for the given string with binary encoding and use Buffer.toString('base64') to return the encoded string.
const btoa = str => Buffer.from(str, 'binary').toString('base64');
btoa('foobar'); // 'Zm9vYmFy'

javascript snippet similar to btoa For You in December 2024

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2024 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️