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
var str:String= Program.open( "LC_CTYPE=C tr -dc 'A-F0-9' < /dev/urandom | head -c 2" );
shorter command line, less dependencies and no risk to block the CLI and end up in an infinite loop while running the function, also avoid a carriage return at end of line
The text was updated successfully, but these errors were encountered:
we need to test this under Windows with cygwin_compat
eg. do we need to call something like C:/cygwin/bin/bash.exe -c 'LC_CTYPE=C tr -dc 'A-F0-9' < /dev/urandom | head -c 2'
or C:/cygwin/bin/sh.exe -c 'LC_CTYPE=C tr -dc 'A-F0-9' < /dev/urandom | head -c 2'
https://code.google.com/p/redtamarin/issues/detail?id=103
see: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/crypto/package.html#generateRandomBytes()
signature:
under Macintosh / Linux we can use /dev/urandom
$ cat /dev/urandom | LC_CTYPE=C tr -dc 'A-F0-9' | fold -w 2 | sed 1q
in AS3 that would gives
Under Windows we need to use
CryptGenRandom()
see PHP implementation of php_win32_get_random_bytes
https://github.com/php/php-src/blob/master/win32/winutil.c#L80
because
Program.open()
call the CLI assh -c ""
it is better to do like that
shorter command line, less dependencies and no risk to block the CLI and end up in an infinite loop while running the function, also avoid a carriage return at end of line
The text was updated successfully, but these errors were encountered: