.test {
width: 20%;
background: red;
aspect-ratio: 1/1;
}Run Code Online (Sandbox Code Playgroud)
<div class="test"></div>Run Code Online (Sandbox Code Playgroud)
aspect-ratio: 1/1;除了 safari 之外,它在其他浏览器中工作正常。但这段代码在 Safari 中不起作用。我使用的是 macOS 11.2。我现在已经更新到 macOS 11.5.2。据我所知它支持 safari,但我无法完全理解这个问题。从现在开始谢谢你。如果有任何遗漏的信息,如果您告诉我,我会添加它。
我正在用 Swift 语言使用 AES256 加密文本并将其输出为十六进制。我想用 JS 解密收到的这段代码,但无法得到结果。我尝试了 CryptoJS 库,但仍然无法得到我想要的结果。我想要的只是 js 代码,当我输入 IV、密码和密文时,它会给我解码版本。
const crypto = require("crypto");
var key = "";
const iv = "";
const token = "";
function decrypt(token, iv, key) {
const decrypter = crypto.createDecipheriv("aes-256-cbc", key, iv);
let decrypted = decrypter.update(token, "hex", "utf8");
decrypted += decrypter.final("utf8");
return decrypted
}
console.log(decrypt(token, iv, key));
Run Code Online (Sandbox Code Playgroud)
通过上面的 Node.js 代码,我实现了我想要的,但我想用普通的 JS 代码来实现,而不是使用 Node。我不想打扰服务器。如果您能提供帮助,我将非常高兴。
编辑:我正在 Swift 语言中使用 CryptoSwift 库。
func encryption(uuid: String, token: String) -> String {
do {
let aes = try AES(key: …Run Code Online (Sandbox Code Playgroud)