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. codeforces 57C 思维

    题意:求出长度为n仅由1到n数字组成的非降序列与非升序列的个数. 思路:转化为求非降序列(非升序列)的个数.n个元素想象为n个离散的点x1,x2,x3,...,xn,在最开头补上一个点x0为1,在最末 ...

  2. mac工作软件推荐-iterm + zsh + tmux

    原文链接: http://ju.outofmemory.cn/entry/57244 tmux安装https://blog.csdn.net/nmgzywd/article/details/50915 ...

  3. Hive split分割后获取最后一段

    ----------------------------------------- 如果只看解决方法,直接看最后... ---------------------------------------- ...

  4. 表达式语句(EL)

    EL的基本语法 ${expression} Expression:制定要输出的变了或字符串.或EL运算符组成的表达式. 禁用EL表达式: 1. 使用“\”符号禁用. \${expression} 2. ...

  5. Native App vs Web App 以及 Hybrid App的实现原理

    移动应用基本的三种类型 1)  Native 应用程序 2)  Web 应用程序 3)  混合应用程序(Hybrid: Native应用和web应用结合) Native 应用 直接运行在电脑上或者智能 ...

  6. java:Eclipse:Could not create the view:解决办法

    Eclipse:Could not create the view: Plug-in org.eclipse.jdt.ui was unable to load class org.eclipse.j ...

  7. Jquery 取值,赋值学习总结

    <h2>获取和设置文本框值:</h2> <input type="button" value="赋值文件框" id="v ...

  8. leetcode 201. Bitwise AND of Numbers Range(位运算,dp)

    Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers ...

  9. ACM学习历程—POJ3090 Visible Lattice Points(容斥原理 || 莫比乌斯)

    Description A lattice point (x, y) in the first quadrant (x and y are integers greater than or equal ...

  10. BZOJ2120:数颜色

    浅谈树状数组与线段树:https://www.cnblogs.com/AKMer/p/9946944.html 题目传送门:https://www.lydsy.com/JudgeOnline/prob ...