This package is intended to be used for hashing a provided JS object in both Node.js and browser(eg-: for Next.js). Users will be provided an option to sort the JS object since order of properties is not guaranteed by JSON.stringify. This sorting will be done using this package which will be imported dynamically. I've kept sorting optional, in case of a string being passed as a parameter to the algorithm.
On the browser side hashing will be done using the inbuilt SubteCrypto Web API which only provides the following algorithms for creating a hash.
SHA-1
SHA-256
SHA-384
SHA-512
In node.js we use the inbuilt crypto module, Even though node.js crpto module provides more algorithms than the ones available in the browser to maintain cross platform compatibility (browser and node.js), I've limited the available algorithms only the ones available in browser.
This package is intended to be used for hashing a provided JS object in both Node.js and browser(eg-: for Next.js). Users will be provided an option to sort the JS object since order of properties is not guaranteed by JSON.stringify. This sorting will be done using this package which will be imported dynamically. I've kept sorting optional, in case of a string being passed as a parameter to the algorithm.
On the browser side hashing will be done using the inbuilt SubteCrypto Web API which only provides the following algorithms for creating a hash.
In node.js we use the inbuilt crypto module, Even though node.js crpto module provides more algorithms than the ones available in the browser to maintain cross platform compatibility (browser and node.js), I've limited the available algorithms only the ones available in browser.