YUILibrary - Open source JavaScript and CSS for building richly interactive software.
Fork YUI on GitHub
  • Home
  • Gallery
  • Forums
  • YUI 2
  • YUI 3
  • YUI Compressor
  • YUI Doc
  • More
  • Gallery Forums
  • Gallery Stats
  • Gallery Calendar
  • Register
  • Login

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • FAQ
  • Developer FAQ
  • Developer Guide
  • Module Setup

Tag Cloud

ericf yui2 davglass filter io form rgrove node apipkin port jafl slideshow plugin skinnable widget nzakas foxxtrot animation jsonp lsmith html5 overlay ajax caridy adam event

Context Navigation

    YUI Library is not responsible for bugs or support with this module. It is available as a free service. For support please contact the module owner with the provided links.

    Base64 (gallery-base64) on cdn

    Last Updated: 12/9/09
    + 2 -

    Nicholas C. Zakas

    YUI Developer

    See 2 more by this user.

    Created: 11/28/09
    Last CDN Push: 12/8/09
    Build Tag: gallery-2009.12.08-22
    Project: YUI 3
    License: YUI BSD
    YUI Version: 3.0.0
    Free for use.

    Base64 encoding is a way to represent 8-bit data as 6-bit chunks for lossless data transmission through 7-bit systems. Recently, base64 encoding has become popular for the creation of data URIs. While some browsers natively support base64 encoding and decoding, all browsers don't, and so this utility aims to enable this capability in all browsers.

    • Tags:
    • nzakas
    • base64
    • encode
    • decode
    • Download
    • Docs
    • Homepage
    • Bugs
    • Source
    • Example
    • Forum
    • History

    There are two basic methods, Y.Base64.encode() and Y.Base64.decode(). Each takes a single argument, the string to work on.

    Y.Base64.encode() throws an error if there are any non-ASCII characters in the input text as base64 encoding can only be used with characters codes 0-255.

    Y.Base64.decode() throws an error if the input string isn't base64 encoded.

    Code Sample

    <script src="http://yui.yahooapis.com/3.1.0/build/yui/yui-min.js"></script>
    YUI({
        //Last Gallery Build of this module
        gallery: 'gallery-2009.12.08-22'
    }).use('gallery-base64', function(Y) {
     
     
        var encodedText = Y.Base64.encode("Hello world!");
     
        var decodedText = Y.Base64.decode(encodedText);
     
    });

    Forum Posts

    No forum posts for this module.

    YUI Projects
    • All YUI Downloads
    • YUI 2
    • YUI 3
    • YUI Doc
    • YUI Compressor
    • YUILibrary.com
    • YUI Build Tool
    • YUI PHP Loader
    Pages & Links
    • All YUI Downloads
    • Git FAQ
    • Graded Browser Support
    • Contribute to YUI
    • Forum Stats
    • Gallery Stats
    • YUI Calendar
    Contribute
    • Submit a Bug
    • Request a Feature
    • Write Code
    • Meet the Team
    Follow YUI
    • on GitHub
    • on Twitter
    • on FriendFeed
    • on Facebook
    • on IRC
    • YUI Blog
    • YUI Theater
    • YUI Forums

    © 2010 YUI Library - Site Credits