// Authorization 加密过程
let email = "aaaaaaa"
let password = "12345678"
let auth = `${email}:${password}`
const buf = Buffer.from(auth, 'ascii');
console.info(buf.toString('base64')); // YWFhYWFhYToxMjM0NTY3OA==
const authorization = buf.toString('base64')
// Authorization 解密过程
const buf = Buffer.from(authorization, 'base64');
const user = buf.toString('ascii');
console.log(user) //aaaaaaa:12345678
Authorization加减密
最新推荐文章于 2023-09-05 10:27:47 发布