Converting Getrandomvalue.browser From Cuid To Typescript?
The cuid() library has this function: var getRandomValue; var crypto = typeof window !== 'undefined' && (window.crypto || window.msCrypto) || typeof self !== 'undefin
Solution 1:
Looks correct translation to me. However, shouldn't it be % lim
instead of / lim
? And even then: the result is somewhat biased towards low values if lim
is not a power of two.
Besides that, I presume that lim
is not negative, so I don't see any reason for the call to abs
function. A single 32 bit unsigned integer should not suddenly turn negative after all, not if it is treated as 64 bit double anyway.
Post a Comment for "Converting Getrandomvalue.browser From Cuid To Typescript?"