random.windows: Saw in the pastebin that some Windows installs still don't
start with this code. Just set the system and secure RNGs to f, and calling them will throw an error. The Mersenne Twister is still the default anyway.db4
parent
b63c9154c3
commit
2f2e04ca45
|
@ -46,8 +46,12 @@ M: windows-crypto-context random-bytes* ( n windows-crypto-context -- bytes )
|
|||
handle>> swap [ ] [ <byte-array> ] bi
|
||||
[ CryptGenRandom win32-error=0/f ] keep ;
|
||||
|
||||
: try-crypto-providers ( seq -- windows-crypto-context )
|
||||
[ first2 <windows-crypto-context> ] attempt-all ;
|
||||
! Some Windows installations still don't work, so just set
|
||||
! system and secure rngs to f
|
||||
: try-crypto-providers ( seq -- windows-crypto-context/f )
|
||||
[
|
||||
[ first2 <windows-crypto-context> ] attempt-all
|
||||
] [ 2drop f ] recover ;
|
||||
|
||||
[
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue