# base64 [![Build status](https://travis-ci.org/mathiasbynens/base64.svg?branch=master)](https://travis-ci.org/mathiasbynens/base64) [![Code coverage status](http://img.shields.io/coveralls/mathiasbynens/base64/master.svg)](https://coveralls.io/r/mathiasbynens/base64)
_base64_ is a robust base64 encoder/decoder that is fully compatible with [`atob()` and `btoa()`](https://html.spec.whatwg.org/multipage/webappapis.html#atob), written in JavaScript. The base64-encoding and -decoding algorithms it uses are fully [RFC 4648](https://tools.ietf.org/html/rfc4648#section-4) compliant.
## Installation
Via [npm](https://www.npmjs.com/):
```bash
npm install base-64
```
In a browser:
```html
<script src="base64.js"></script>
```
In [Narwhal](http://narwhaljs.org/), [Node.js](https://nodejs.org/), and [RingoJS](http://ringojs.org/):
```js
var base64 = require('base-64');
```
In [Rhino](http://www.mozilla.org/rhino/):
```js
load('base64.js');
```
Using an AMD loader like [RequireJS](http://requirejs.org/):
```js
require(
{
'paths': {
'base64': 'path/to/base64'
}
},
['base64'],
function(base64) {
console.log(base64);
}
);
```
## API
### `base64.version`
A string representing the semantic version number.
### `base64.encode(input)`
This function takes a byte string (the `input` parameter) and encodes it according to base64. The input data must be in the form of a string containing only characters in the range from U+0000 to U+00FF, each representing a binary byte with values `0x00` to `0xFF`. The `base64.encode()` function is designed to be fully compatible with [`btoa()` as described in the HTML Standard](https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-btoa).
```js
var encodedData = base64.encode(input);
```
To base64-encode any Unicode string, [encode it as UTF-8 first](https://github.com/mathiasbynens/utf8.js#utf8encodestring):
```js
var base64 = require('base-64');
var utf8 = require('utf8');
var text = 'foo © bar ð baz';
var bytes = utf8.encode(text);
var encoded = base64.encode(bytes);
console.log(encoded);
// â 'Zm9vIMKpIGJhciDwnYyGIGJheg=='
```
### `base64.decode(input)`
This function takes a base64-encoded string (the `input` parameter) and decodes it. The return value is in the form of a string containing only characters in the range from U+0000 to U+00FF, each representing a binary byte with values `0x00` to `0xFF`. The `base64.decode()` function is designed to be fully compatible with [`atob()` as described in the HTML Standard](https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-atob).
```js
var decodedData = base64.decode(encodedData);
```
To base64-decode UTF-8-encoded data back into a Unicode string, [UTF-8-decode it](https://github.com/mathiasbynens/utf8.js#utf8decodebytestring) after base64-decoding it:
```js
var encoded = 'Zm9vIMKpIGJhciDwnYyGIGJheg==';
var bytes = base64.decode(encoded);
var text = utf8.decode(bytes);
console.log(text);
// â 'foo © bar ð baz'
```
## Support
_base64_ is designed to work in at least Node.js v0.10.0, Narwhal 0.3.2, RingoJS 0.8-0.9, PhantomJS 1.9.0, Rhino 1.7RC4, as well as old and modern versions of Chrome, Firefox, Safari, Opera, and Internet Explorer.
## Unit tests & code coverage
After cloning this repository, run `npm install` to install the dependencies needed for development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.
Once thatâs done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use `grunt test`.
To generate the code coverage report, use `grunt cover`.
## Author
| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
|---|
| [Mathias Bynens](https://mathiasbynens.be/) |
## License
_base64_ is available under the [MIT](https://mths.be/mit) license.
没有合适的资源?快使用搜索试试~ 我知道了~
2023去水印小程序源码修复版
共298个文件
vue:101个
js:72个
json:35个
需积分: 5 4 下载量 63 浏览量
2023-09-18
13:36:11
上传
评论
收藏 10.7MB ZIP 举报
温馨提示
2023去水印小程序源码修复版
资源推荐
资源详情
资源评论
收起资源包目录
2023去水印小程序源码修复版 (298个子文件)
iconfont.css 79KB
icon.css 71KB
main.css 66KB
animation.css 3KB
刀客源码网.html 6KB
index.html 692B
vendor.js 139KB
area.js 122KB
async-validator.js 34KB
weCropper.js 32KB
MpHtmlParser.js 19KB
city.js 14KB
md5.js 12KB
u-lazy-load.js 11KB
tabbar.js 9KB
md5.js 9KB
index.js 7KB
index.js 6KB
images.js 5KB
video.js 5KB
base64.js 5KB
runtime.js 5KB
common.js 5KB
index.js 5KB
u-icon.js 5KB
index.js 4KB
test.js 4KB
colorGradient.js 4KB
u-waterfall.js 4KB
route.js 4KB
u-row-notice.js 3KB
batch.js 3KB
u-swiper.js 3KB
md5.js 3KB
main.js 3KB
u-column-notice.js 3KB
CssHandler.js 3KB
util.js 3KB
mine.js 3KB
u-loadmore.js 3KB
u-notice-bar.js 3KB
config.js 3KB
problem.js 2KB
u-line.js 2KB
timeFormat.js 2KB
emitter.js 2KB
u-loading.js 2KB
cu-custom.js 2KB
guid.js 2KB
getParent.js 2KB
mixin.js 2KB
timeFrom.js 2KB
queryParams.js 2KB
province.js 1KB
about.js 1KB
instructions.js 1KB
type2icon.js 1011B
debounce.js 910B
color.js 892B
deepMerge.js 818B
throttle.js 802B
$parent.js 794B
deepClone.js 681B
index.js 502B
mpShare.js 383B
addUnit.js 381B
zIndex.js 362B
trim.js 354B
main.js 342B
randomArray.js 235B
config.js 208B
random.js 206B
toast.js 148B
sys.js 139B
batch-u-waterfall-right.js 104B
batch-u-waterfall-left.js 103B
app.js 89B
bem.js 64B
manifest.json 3KB
pages.json 2KB
package.json 2KB
package.json 1KB
package.json 740B
project.config.json 589B
app.json 583B
launch.json 520B
batch.json 431B
batch-u-waterfall-left.json 386B
batch-u-waterfall-right.json 386B
project.private.config.json 343B
package-lock.json 329B
u-notice-bar.json 199B
index.json 168B
u-loadmore.json 163B
images.json 150B
u-waterfall.json 140B
tabbar.json 126B
u-row-notice.json 102B
u-column-notice.json 102B
mine.json 96B
共 298 条
- 1
- 2
- 3
资源评论
l773177741
- 粉丝: 2
- 资源: 20
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 部署yolov8的tensorrt模型支持检测分割姿态估计的C++源码+部署步骤.zip
- 以简单、易用、高性能为目标、开源的时序数据库,支持Linux及Windows, Time Series Database.zip
- python-leetcode面试题解之第198题打家劫舍-题解.zip
- python-leetcode面试题解之第191题位1的个数-题解.zip
- python-leetcode面试题解之第186题反转字符串中的单词II-题解.zip
- 一个基于python的web后端高性能开发框架,下载可用
- python-leetcode面试题解之第179题最大数-题解.zip
- python-leetcode面试题解之第170题两数之和III数据结构设计-题解.zip
- python-leetcode面试题解之第168题Excel表列名称-题解.zip
- python-leetcode面试题解之第167题两数之和II输入有序数组-题解.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功