javascript - Using Crypto-JS (commonjs) in titanium -
i not familiar commonjs conception, strategy might wrong..
i want use cryptojs.hmac() , cryptojs.sha256 in titanium
i have downloaded cryptojs v3.1.2.zip here.
then copy files under resources/cryptjs/ .
then add last line in core.js
return c; }(math)); module.export = cryptojs; //add line
now in app.js
var cryptojs = require('./cryptojs/components/core'); cryptojs.hmac(cryptojs.sha256, datestamp, testkey, { asbytes: true});
however shows
undefined not function
error when call cryptojs.hmac()
can have help?
you find commonjs version of crypto js on npm: https://www.npmjs.com/package/browserify-cryptojs
maybe got more luck that!
Comments
Post a Comment