github.com/igggame/nebulas-go@v2.1.0+incompatible/nf/nvm/test/contract_crypto.js (about) 1 // since version 1.0.5 2 3 'use strict'; 4 5 var crypto = require('crypto.js'); 6 7 8 var Contract = function() { 9 10 }; 11 12 Contract.prototype = { 13 init: function(){}, 14 15 testSha256: function(data) { 16 return crypto.sha256(data); 17 }, 18 19 testSha3256: function(data) { 20 return crypto.sha3256(data); 21 }, 22 23 testRipemd160: function(data) { 24 return crypto.ripemd160(data); 25 }, 26 27 testRecoverAddress: function(alg, hash, sign) { 28 return crypto.recoverAddress(alg, hash, sign); 29 }, 30 31 testMd5: function(data) { 32 return crypto.md5(data); 33 }, 34 35 testBase64: function(data) { 36 return crypto.base64(data); 37 } 38 }; 39 40 module.exports = Contract;