Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/youngjuning/wxBase64
:building_construction:在小程序中使用 js-base64 库
https://github.com/youngjuning/wxBase64
base64 miniapp weixin wexin wxapp
Last synced: 3 months ago
JSON representation
:building_construction:在小程序中使用 js-base64 库
- Host: GitHub
- URL: https://github.com/youngjuning/wxBase64
- Owner: youngjuning
- License: mit
- Created: 2018-04-29T03:32:59.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-04-29T03:33:09.000Z (about 6 years ago)
- Last Synced: 2024-01-06T23:57:28.661Z (6 months ago)
- Topics: base64, miniapp, weixin, wexin, wxapp
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 20
- Watchers: 3
- Forks: 16
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-wechat-weapp - wxBase64 - 微信小程序base64 库 (组件)
- awesome-wechat-weapp - wxBase64 - 微信小程序base64 库 (组件)
- awesome-wechat-app - wxBase64 - 微信小程序base64 库 (组件)
- awesome-wechat-weapp - wxBase64 - 微信小程序base64 库 (组件)
- awesome-wechat-weapp - wxBase64 - 微信小程序base64 库 (组件)
- awesome-wechat-weapp - wxBase64 - 微信小程序base64 库 (组件)
- awesome-wechat-weapp - wxBase64 - 微信小程序base64 库 (组件)
README
# wxBase64
## 引入
### node.js
```js
let Base64 = require('js-base64').Base64
```### es6+
```js
import {Base64} from '/utils/base64.min.js'
```## 使用
```js
Base64.encode('youngjuning'); // eW91bmdqdW5pbmc=
Base64.encode('杨俊宁'); // 5p2o5L+K5a6B
Base64.encodeURI('杨俊宁'); // 5bCP6aO85by-Base64.decode('eW91bmdqdW5pbmc='); // youngjuning
Base64.decode('5p2o5L+K5a6B'); // 杨俊宁
// note .decodeURI() is unnecessary since it accepts both flavors
Base64.decode('5bCP6aO85by-'); // 杨俊宁
```## 感谢
感谢 dankogai [![GitHub followers](https://img.shields.io/github/followers/dankogai.svg?style=social&label=Follow)](https://github.com/dankogai) 开发了 js-base64 [![GitHub stars](https://img.shields.io/github/stars/dankogai/js-base64.svg?style=social&label=Stars)](https://github.com/dankogai/js-base64)