This isn't a duplicate, but it should explain, why your code doesn't work: What is the difference between a string and a byte string? A byte string in Python isn't a hex encoding of a string.
The equivalent Node.js code is:
const salt = Buffer.from("0000000000000000004d6ec16dafe9d8370958664c1dc422f452892264c59526");
without 'hex'
. The default encoding is 'utf8'
.
You can see it with:
salt = b"0000000000000000004d6ec16dafe9d8370958664c1dc422f452892264c59526"
print(' '.join(map(str, salt)))
# output:
# 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 52 100 54 101 99 49 54 100 97 102 101 57 100 56 51 55 48 57 53 56 54 54 52 99 49 100 99 52 50 50 102 52 53 50 56 57 50 50 54 52 99 53 57 53 50 54
and
const salt = Buffer.from("0000000000000000004d6ec16dafe9d8370958664c1dc422f452892264c59526");
console.log(salt.join(' '));
// output:
// 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 52 100 54 101 99 49 54 100 97 102 101 57 100 56 51 55 48 57 53 56 54 54 52 99 49 100 99 52 50 50 102 52 53 50 56 57 50 50 54 52 99 53 57 53 50 54