var app = angular.module("encodeDecode", []);  

app.controller("encodeDecodeCtrl", ($scope, str) => {
$scope.encode = btoa(str);
$scope.decode = atob(str);
});

angular使用base64的encode和decode的更多相关文章

  1. 关于base64编码Encode和Decode编码的几种方式

    关于base64编码Encode和Decode编码的几种方式 Base64是一种能将任意Binary资料用64种字元组合成字串的方法,而这个Binary资料和字串资料彼此之间是可以互相转换的,十分方便 ...

  2. 关于base64编码Encode和Decode编码的几种方式--Java

    Base64是一种能将任意Binary资料用64种字元组合成字串的方法,而这个Binary资料和字串资料彼此之间是可以互相转换的,十分方便.在实际应用上,Base64除了能将Binary资料可视化之外 ...

  3. 用node.js写个在Bash上对字符串进行Base64或URL的encode和decode脚本

    一:自己这段时间经常要用到Base64编码和URL编码,写个编译型语言有点麻烦干脆就用node.js弄了个,弄好后在/etc/profile里加上alias就能完成工具的配置,先上代码: functi ...

  4. python的str,unicode对象的encode和decode方法

    python的str,unicode对象的encode和decode方法 python中的str对象其实就是"8-bit string" ,字节字符串,本质上类似java中的byt ...

  5. python的str,unicode对象的encode和decode方法(转)

    python的str,unicode对象的encode和decode方法(转) python的str,unicode对象的encode和decode方法 python中的str对象其实就是" ...

  6. python的str,unicode对象的encode和decode方法, Python中字符编码的总结和对比bytes和str

    python_2.x_unicode_to_str.py a = u"中文字符"; a.encode("GBK"); #打印: '\xd6\xd0\xce\xc ...

  7. [LeetCode] Encode and Decode Strings 加码解码字符串

    Design an algorithm to encode a list of strings to a string. The encoded string is then sent over th ...

  8. 【python】python新手必碰到的问题---encode与decode,中文乱码[转]

    转自:http://blog.csdn.net/a921800467b/article/details/8579510 为什么会报错“UnicodeEncodeError:'ascii' codec ...

  9. LeetCode Encode and Decode Strings

    原题链接在这里:https://leetcode.com/problems/encode-and-decode-strings/ 题目: Design an algorithm to encode a ...

随机推荐

  1. springmvc的优化

    二.springmvc的工作机制 在容器初始化时会建立所有url和controller的对应关系,保存到Map<url,controller>中.tomcat启动时会通知spring初始化 ...

  2. 剑指offer之 数组中出现次数超过一半的数字

    public class Solution { public int MoreThanHalfNum_Solution(int [] array) { if(array==null||array.le ...

  3. IE Firefox css 差别

    1.单位问题 问题:任何距离的数值ie可以不加单位,ff必须要求写单位(0除外) 解决:写全单位如padding:0px; 2.水平居中 问题:div里的内容,ie默认为center,而ff默认lef ...

  4. Java Applet:练习TextField类和TextArea类的文本事件

    出自: Java语言与面向程序程序设计(第二版) 第七章第五节P223 1. [代码]java代码 /** *这个程序主要来练习文本事件,当在文本框(TextField)中输入文字时,会在文本域(Te ...

  5. css3加载spinner

    使用代码制作一个加载旋转器spinner 实现的原理是: 1.两个圆圈,其中一个圆圈是使用pseudo元素(:before)产生 2.由pseudo元素生成的圆通过负数的z-index而作用在下面 3 ...

  6. Redis安装以及基本操作命令

    Redis安装 cd redis-2.6.14make PREFIX=/usr/local/redis install 可能会出现的错误提示>>提示1:make[3]: gcc:命令未找到 ...

  7. java支付宝开发-异常-01-"sub_code":"isv.invalid-app-id","sub_msg":"无效的AppID参数"

    一.现象 无论请求哪个接口都报这个错误 二.异常原因 后来检查了一下,发现是因为 我支付宝网关写错了.沙箱环境和正式环境 的支付宝网关不同,如下 //支付宝网关名-正式环境 //public stat ...

  8. jQuery 事件 - one() 方法

    jQuery 事件参考手册 实例 当点击 p 元素时,增加该元素的文本大小: $("p").one("click",function(){ $(this).an ...

  9. python-管理MySQL之ConfigParser模块

    1.拷贝2.7版本的ConfigParser.py模块支持无值解析 cp /usr/local/src/Python-2.7.5/Lib/ConfigParser.py /usr/lib/python ...

  10. python-多线程(一)

    一.Python中的线程使用: Python中使用线程有两种方式:函数或者用类来包装线程对象. 1.  函数式:调用thread模块中的start_new_thread()函数来产生新线程.如下例: ...