tyn-hash-creator
v0.0.3
Published
Hash Creator Within PHP function on NodeJS application to promise
Downloads
1
Maintainers
Readme
tyn-hash-creator
Hash Creator Within PHP function on NodeJS application to promise
Installation
bash npm install tyn-hash-creator
Usage
var execPhp = require('tyn-hash-creator').phpExec
var mhash = await execPhp(path, phpbin,data, iv, salt, saltWithPassword)
Arguments
path::string
Path to user php file.phpbin::string
Path to engine php binary file.callback::function
its a promise function with use await or then, catch
Example
// file.php
<?
function tynhash($data,$iv,$salt,$saltWithPassword)
{
$encrypted = openssl_encrypt("$data", 'aes-256-cbc', "$saltWithPassword", null, $iv);
$msg_encrypted_bundle = "$iv:$salt:$encrypted";
$msg_encrypted_bundle = str_replace('/', '__', $msg_encrypted_bundle);
return $msg_encrypted_bundle;
}
?>
// app.js
var execPhp = require('tyn-hash-creator').phpExec
var mhash = await execPhp(path, phpbin,data, iv, salt, saltWithPassword)