lastleaf / miniprogram-rust-wasm-example Goto Github PK
View Code? Open in Web Editor NEWLicense: The Unlicense
License: The Unlicense
您好,ios真机上能通过吗?
添加了md5 = "0.7.0"
use js_sys::*;
#[wasm_bindgen]
pub fn md5(data: JsValue) -> JsValue {
let data: String = JsString::from(data).into();
let digest = md5::compute(data.as_bytes());
let hex: JsString = JsString::from(format!("{:x}", digest).as_str());
JsValue::from(JsString::from(hex))
}
错误内容如下:
VM112 WAService.js:2 TypeError: fimport$0 is not a function
at Object.$80 [as sum] (rust_mod_bg.wasm.js? [sm]:4053)
at sum (rust_mod_bg.js? [sm]:126)
at se.onLoad (index.js? [sm]:13)
at se.<anonymous> (VM112 WAService.js:2)
at se.c.__callPageLifeTime__ (VM112 WAService.js:2)
at Le (VM112 WAService.js:2)
at Ye (VM112 WAService.js:2)
at Function.<anonymous> (VM112 WAService.js:2)
at i.<anonymous> (VM112 WAService.js:2)
at i.emit (VM112 WAService.js:2)
errorReport @ VM112 WAService.js:2
thirdErrorReport @ VM112 WAService.js:2
(anonymous) @ VM112 WAService.js:2
(anonymous) @ VM112 WAService.js:2
c.__callPageLifeTime__ @ VM112 WAService.js:2
Le @ VM112 WAService.js:2
Ye @ VM112 WAService.js:2
(anonymous) @ VM112 WAService.js:2
(anonymous) @ VM112 WAService.js:2
i.emit @ VM112 WAService.js:2
emit @ VM112 WAService.js:2
(anonymous) @ VM112 WAService.js:2
i.emit @ VM112 WAService.js:2
emit @ VM112 WAService.js:2
(anonymous) @ VM112 WAService.js:2
(anonymous) @ VM112 WAService.js:2
c @ VM8 asdebug.js:1
l @ VM8 asdebug.js:1
(anonymous) @ VM8 asdebug.js:1
f @ VM8 asdebug.js:1
g @ VM8 asdebug.js:1
(anonymous) @ VM8 asdebug.js:1
_ws.onmessage @ VM8 asdebug.js:1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.