node.js - How to use nodejs crypto pbkdf2 salt of type bytes array in php hash_pbkdf2

one text

Solution:

The salt is:

"\x01\x02\x03\x04\x05\x06\x07\x08"

so literally that.

Or if you want it to look overcomplicated like the JS code:

$salt = implode('', array_map('chr', [ 1, 2, 3, 4, 5, 6, 7, 8 ]));

Also:

  1. Salts should be unique per-hash.
  2. Salts are not considered secret value.
  3. Most password hashing libs just pack the salt into the first X bytes of the output.

Source