How can I convert this function to nodejs : <p>I have this php function for encrypt data, how can I convert it to NodeJS?</p>

<pre><code>&lt;?php

function Encrypt($input, $key_seed){
     $input = trim($input);
     $block = mcrypt_get_block_size('tripledes', 'ecb');
     $len = strlen($input);
     $padding = $block - ($len % $block);
     $input .= str_repeat(chr($padding),$padding);
     // generate a 24 byte key from the md5 of the seed
     $key = substr(md5($key_seed),0,24);
     $iv_size = mcrypt_get_iv_size(MCRYPT_TRIPLEDES, MCRYPT_MODE_ECB);
     echo "--" . $iv_size . "\n";
     $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
     // encrypt
     $encrypted_data = mcrypt_encrypt(MCRYPT_TRIPLEDES, $key,
     $input, MCRYPT_MODE_ECB, $iv);
     // clean up output and return base64 encoded
     return base64_encode($encrypted_data);
}
</code></pre>

<p>Help me please! Thank you!</p>
