crypto compat with JS