Q:

Meteor Server: ReferenceError: calcMD5 is not defined

Due to some existing mongodb structure. I cant use Meteors Meteor.user. So when I try to insert new user calcMD5 says is not defined. How do I convert Md5 in meteor server? I dont know weather my approach is good or not. correct me if am wrong.
if (Meteor.isServer) {
 newUser: function(email, password){
  Users.insert({"emailid":email,"password":calcMD5(password)});
 }
});

Here the template code
Template.signInWithEmail.events({
 'click .btn-create-account': function(event, template) {
  email = $('[name="emailAddress"]').val();
  password = $('[name="password"]').val();

  //Create new user
  Meteor.call("newUser", email, password, function(error, result) {});
}

A:

Problem is, the calcMD5 function does not exist in Meteor as it is. (nor JavaScript, nor NodeJS) I will assume you want to use this library or another one for your project.
If you want to be able to use an external library, you have to first add it into your Meteor project. You can do this by simply putting the javascript file in a folder such as server/lib/.
Or, if this gets too complicated, just add the crypto-md5 meteor package using:
meteor add jparker:crypto-md5

and call CryptoJS.MD5(password) instead of your calcMD5(password) function call.

