You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, if anyone else finds this issue like I did and is using cloudflare workers, here's what worked for me:
import{monotonicFactory}from'ulid'// or import {factory} from 'ulid'constprng=()=>{constbuffer=newUint8Array(1)crypto.getRandomValues(buffer)returnbuffer[0]/0xff}exportconstulid=monotonicFactory(prng)// or factory(prng)
This will bypass the code that checks for browser crypto and allow you to set your own. The PRNG function is the same as used internally with a different global reference.
I think this package may be abandoned, I'm working on potentially forking it.
in order to detect the browser, you need to take into account that the code can be executed in the worker and there is no window, but there is self
should be rewritten as
The text was updated successfully, but these errors were encountered: