open-attestation
open-attestation copied to clipboard
chore: replace node crypto with browserify module
Due to webpack v5 not including all polyfills by default, downstream websites/libraries consuming @govtechsg/open-attestation would lead to build errors if one uses create-react-app to build and construct their site.
This is highlighted in this issue: https://github.com/Open-Attestation/open-attestation/issues/239
This chore replaces the current way we are using the randomBytes
function from node crypto and makes it isomorphic via the browserify module.
In the first place is this something the lib should be concerned about? in the issue above, i told the guy to handle the polyfills at the application level.