Properly hashing is difficult. Some popular hashing algorithms have been probed vulnerable (MD5)
So, here are a couple of options that allow to hash in a cryptographically safe way.
Using md5 (popular but not recommended)
(Documentation about blake2)[https://www.blake2.net/]
(Claims to be stronger that sha1, and as strong as sha3 but faster)[https://www.npmjs.com/package/blake2]
(A way more improved hashing than md5)[https://www.npmjs.com/package/sha3]