the problem arises when there is a need to use getrandom because some other dependency needs it.
ic_cdk::management_canister::raw_rand() is not an option as it is async and the extern fn cannot call. What is a way to get random numbers without async here (if any)?
I’m using both because some crates use getrandom v2 and some use v3 and I have to include both and enable custom backend for them because otherwise builds fail
I ended up returning Error::UNEXPECTED, which is probably more accurate than just a 0.
—
My solution is a combination of what everyone has posted, thanks y’all. I apparently can’t post links here so I made a gist of it at ranile/2a7d4d3d2c3a8689e5196a537bbcbfae