Base64 URL Converter

Posted by: Joy CrazyDaVinci  :  Category: Web Development

Base64 URL ConverterBase64 is a group of similar encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. The Base64 term originates from a specific MIME content transfer encoding. I just created another simple tools for URL using base64 encoding for you guys who want to use a data URI scheme on your website. Let’s talk about data URI scheme itself first.

Based on wikipedia, the data URI scheme is a URI scheme (Uniform Resource Identifier scheme) that provides a way to include data in-line in web pages as if they were external resources. It tends to be simpler than other inclusion methods, such as MIME with cid or mid URIs. Data URIs are sometimes called Uniform Resource Locators, although they do not actually locate anything remote. The data URI scheme is defined in RFC 2397 of the Internet Engineering Task Force (IETF).

Format

data:[<MIME-type>][;charset=<encoding>][;base64]

Examples :

HTML

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==
" alt="Red dot" />

CSS

ul.checklist li.complete {
margin-left: 20px;
background: white url('data:image/png;base64,iVBORw0KGgoAA
AANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0l
EQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6
P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC
') no-repeat scroll left top;
}


You can even add this on javascript, php inclusion, etc. To make it easier for you to convert the file into this type of format, below is the tool you can use to convert your remote file into a data URI scheme using base64 encoding :

arrow  Base64 URL Converter

By using the Data URI Scheme functionality, you can gain more advantages, such as :

  • HTTP request and header traffic is not required for embedded data, so data URIs consume less bandwidth whenever the overhead of encoding the inline content as a data URI is smaller than the HTTP overhead. For example, the required base64 encoding for an image 600 bytes long would be 800 bytes, so if an HTTP request required more than 200 bytes of overhead, the data URI would be more efficient.
  • For transferring many small files (less than a few kilobytes each), this can be faster. TCP transfers tend to start slowly. If each file requires a new TCP connection, the transfer speed is limited by the round-trip time rather than the available bandwidth. Using HTTP keep-alive improves the situation, but may not entirely alleviate the bottleneck.
  • When browsing a secure HTTPS web site, web browsers commonly require that all elements of a web page be downloaded over secure connections, or the user will be notified of reduced security due to a mixture of secure and insecure elements. On badly configured servers, HTTPS requests have significant overhead over common HTTP requests, so embedding data in data URIs may improve speed in this case.
  • Web browsers are usually configured to make only a certain number (often two) of concurrent HTTP connections to a domain, so inline data frees up a download connection for other content.
  • Environments with limited or restricted access to external resources may embed content when it is disallowed or impractical to reference it externally. For example, an advanced HTML editing field could accept a pasted or inserted image and convert it to a data URI to hide the complexity of external resources from the user. Alternatively, a browser can convert (encode) image based data from the clipboard to a data URI and paste it in a HTML editing field. Latest Mozilla Firefox also supports this functionality.
  • It is possible to manage a multimedia page as a single file.
  • Email message templates can contain images (for backgrounds or signatures) without the image appearing to be an “attachment”.

That’s it, you can choose the best time when to use this functionality on your website and when not to use, it’s all up to you. Hope this information would help you a lot. Happy tweaking ;)


7 Responses to “Base64 URL Converter”

  1. 1
    j rei t Says:

    waow.. mantaf nih bang Joy, udah langsung di post n dibuat tutorialnya..
    KEREN bgt meskipun gk ngerti byk ane hhee..

  2. 2
    Joy Says:

    makasih buat bro yg ksh ide buat bkin post baru.. bingung dr dlu mau bkin post tp temanya apa.. hihi.. mksh bro dah mampir ;)

  3. 3
    Beben Koben Says:

    oh ini mah convert dari URL yg sudah ada yah!
    kirain teh bs dari upload juga..xixixixi

    semangat bosss \m/

  4. 4
    Sakahayang Dot Com Says:

    makasih sudah share bung ,,,

  5. 5
    Joy Says:

    @Beben Koben
    iya bro :) hanya bs pk remote url

    @Sakahayang
    sama2 mas bro ;) mkasih udah mampir..

  6. 6
    rezki nuarta Says:

    nice article bro i’m interested

  7. 7
    Joy Says:

    @rezki nuarta
    thx for comming n leaving ur comment bro ;)

Leave a Reply

Comment moderation is enabled. Your comment may take some time to appear.