Open-Attestation / open-attestation

Meta framework for providing digital provenance and integrity to documents.
https://openattestation.com
Apache License 2.0
54 stars 18 forks source link

chore: replace node crypto with browserify module #250

Open cavacado opened 1 year ago

cavacado commented 1 year ago

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.