The current repo belongs to Paused status, and some functions are restricted. For details, please refer to the description of repo status
16 Star 84 Fork 18

SLICE30K / Base64.js
Paused

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
example.html 1.38 KB
Copy Edit Raw Blame History
SLICE30K authored 2017-07-25 16:59 . 添加使用示例,更新README
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example</title>
<script src="base64.js"></script>
</head>
<body>
<h1>Base64.js</h1>
<textarea id="input" cols="80" rows="10"></textarea>
<br>
<button onclick="normal_encode()">普通Base64编码</button>
<button onclick="normal_decode()">普通Base64解码</button>
<button onclick="url_safe_encode()">URL_safe Base64编码</button>
<button onclick="url_safe_decode()">URL_safe Base64解码</button>
<br>
<textarea id="output" cols="80" rows="10" readonly></textarea>
<script type="text/javascript">
function normal_encode() {
var raw = document.getElementById("input").value;
var encoded = BASE64.encode(raw);
document.getElementById("output").value = encoded;
}
function normal_decode() {
var raw = document.getElementById("input").value;
var decoded = BASE64.decode(raw);
document.getElementById("output").value = decoded;
}
function url_safe_encode() {
var raw = document.getElementById("input").value;
var encoded = BASE64.urlsafe_encode(raw);
document.getElementById("output").value = encoded;
}
function url_safe_decode() {
var raw = document.getElementById("input").value;
var decoded = BASE64.urlsafe_decode(raw);
document.getElementById("output").value = decoded;
}
</script>
</body>
</html>
JavaScript
1
https://gitee.com/slice30k/base64-js.git
git@gitee.com:slice30k/base64-js.git
slice30k
base64-js
Base64.js
master

Search