Say I have one website created with the LAMP stack and another with the MEAN stack. I want to create a program which estimates the entropy of a password so that I can add a password strength meter to the sign up pages on both sites. I do not want to write the same same program in both PHP and Javasript.
What is the best (or at least standard) way of facilitating interop between my entropy program and LAMP/MEAN servers?
It seems like the easiest way would be to use PHP's exec
or Node's child_process.exec
to call my entropy program, but I always read literature warning against direct system calls. Or is it the case that it just has to be done right?
Should I use UNIX sockets?
Should I create a REST (or WS*) API for the entropy program which is only accessible from the same server?
Is there another method?
In this case I plan on using C for the entropy program, but I am looking for a solution which works with any language: complied or interpreted.