Code Monkey home page Code Monkey logo

jquery.base64.js's Introduction

jQuery.base64.js

(feel free to write a bit about it)

You can check for btoa and atob support and refer to jQuery.base64

if (!window.btoa) window.btoa = $.base64.btoa
if (!window.atob) window.atob = $.base64.atob

Options

You can define some options per default, set them globally use the following syntax:

$.base64.utf8encode = true;

Utf8 encoding and decoding as global option, possibilities:

option description default
raw If false it encodes/decodes both, the input and output. true
utf8encode To encode only the input you can set encodung to true. false
utf8decode Same as above but for the output and decoding. false

You can override the global options by passing an extra parameter:

$.base64[property](<value>, options); / $.base64(<property>, <value>, options);

To enable UTF8-encoding pass true as the last paramter:

$.base64.atob(<value>, true);
$.base64('atob', <value>, true);

Download

Get the raw script, download the complete package or fork it on GitHub.

Support

@yckart #jquery #base64 http://yckart.com

Thanks

###License Copyright (c) 2013 Yannick Albert (http://yckart.com/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

jquery.base64.js's People

Stargazers

Shiqi_SQ avatar Dfer.Site avatar  avatar Sword avatar Wiiliam Woo avatar  avatar 三聿 avatar  avatar Charles avatar 扛狼 avatar  avatar  avatar  avatar dugang avatar  avatar iVampireSP.com avatar 兔咖 avatar _Chenbing avatar Leptune~ avatar Martin avatar JP avatar little avatar zoeelf avatar  avatar 阿北 avatar  avatar 小熊猫 avatar CBQ avatar Robin Zhao avatar CHAOS avatar chenfei avatar hanbd avatar  avatar  avatar Samuel Costa avatar 刘明野 avatar  avatar  avatar Flyer Angel avatar  avatar  avatar 余温gent1e avatar  avatar  avatar  avatar  avatar freedom2016 avatar lingchen avatar Sharl.Jimh.Tsin avatar Jam avatar Muhammed K K avatar  avatar LGD.HuaFEEng avatar  avatar 织梦先生 avatar zac_ma avatar phpone avatar 麻辣石头 avatar HadesZ avatar ITCSs Developer avatar Victor Braun avatar Dennis Y. Parygin avatar Günter Bailey avatar qianduanying avatar  avatar  avatar Mark Choi avatar 爱吃猫粮的鱼 avatar  avatar Json Jeong avatar bzxjp avatar Fil avatar  avatar Eric avatar  avatar zhenizhui avatar Serhii Shyran avatar acrens avatar Josha Munnik avatar Thomas D'Ascoli avatar yuki070 avatar Ocean Ho avatar Nuno avatar DexterLab avatar liyifei avatar Julian avatar  avatar  avatar  avatar  avatar O0oo0O avatar Eker 生哥 avatar jurnlee avatar Michael Bowen avatar  avatar hayden avatar  avatar 爱吃猫的鱼 avatar Éderson T. Szlachta avatar matt vrtis avatar

Watchers

Yannick Albert avatar huangyuan413026 avatar  avatar  avatar

jquery.base64.js's Issues

Questions regarding external code

According to the README, the project itself is subject to the MIT license. Reading
through the repository, there are two further references to external code:

  1. There is

    * Based upon: https://gist.github.com/Yaffle/1284012
    The corresponding GitHub Gist does not carry any copyright notice. Is there any evidence that @Yaffle acknowledged the MIT license here?

  2. In https://github.com/yckart/jquery.base64.js#thanks, there is a thank you notice for https://github.com/carlo/jquery-base64. To which extent is the referenced code part of jquery.base64.js? It is not really clear to me how both repositories do relate.

4byte UTF-8 character decoding

Hi,

unfortunatly UTF 8 mb-characters with 4 bytes don't seem to work with this library.

8J+Sow==

should be decoded to a bomb-emoji (💣), but instead gets translated into garbled data.

2byte emojis like 4piU work fine. ->☔

Any ideas?

Thanks,
Tobias

> symbol falls off

When trying to use $.base64.encode to keep code from breaking.

I need to store in my database "Name"

issue:
earlier version i had dropped the > off the end if i had 1,4,7,10 characters between brackets

this version is still dropping on <0123456789>

I grab id and $.base64.encode( $(this).val() ) &...next...

update: it encodes correctly and works correctly except I have noticed that the + falls off the end via ajax, which losses the > bracket. Still investigating.

Thanks in Advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.