$ node -p 'crypto.createHash("sha256").update("secret").digest()'
<Buffer 2b b8 0d 53 7b 1d a3 e3 8b d3 03 61 aa 85 56 86 bd e0 ea cd 71 62 fe f6 a2 5f e9 7b f5 27 a2 5b>
$ php -r 'print(hash("sha256","secret"));'
2bb80d537b1da3e38bd30361aa855686bde0eacd7162fef6a25fe97bf527a25b
Без этого вопрос слишком абстрактный