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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -