Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? PPC
U-Boot SLB Linux Amiga OS Dual Boot Hardware Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Miscellaneous

Pseudo-random Data Generator

Random-Handler generates a contiguous stream of data using a pseudo-random number generator based upon the SHA-256 cryptographic hash function. The generator is reseeded regularly using the timer.device entropy gathering process.

It is accessed via the RANDOM: device which must be mounted before it can be used, and it is read-only using the following synopsis:

Open("RANDOM:[TEXT/LINELENGTH=<number>/SIZE=<number>]",...); The RANDOM: device defaults to generate a neverending stream of binary data.

To produce ASCII text data instead, use the TEXT switch - this will include upper and lower case characters, numbers and special characters.

To limit the lengths of the text lines produced, use the LINELENGTH=<number> option. After every line of the specified length it will insert a 'line-feed' (X'0A') character.

You can limit the amount of data produced with the SIZE=<number> option. However, when the LINELENGTH=<number> option is also specified, any inserted line feeds are included in the size calculation.

PACKETS
  ACTION_FINDINPUT
  ACTION_READ
  ACTION_END
  ACTION_IS_FILESYSTEM

Example 1:

3.OS4:> MOUNT RANDOM: QUIET
3.OS4:> TYPE "RANDOM:TEXT/SIZE=10"
sHxuKF5ZIW3.OS4:>
Generates 10 characters and prints the text with the "TYPE" shell command.

Example 2:

3.OS4:> MOUNT RANDOM: QUIET
3.OS4:> TYPE "RANDOM:TEXT/LINELENGTH=10/SIZE=22"
4UPV27bpgI
A2pUKjhZwr
3.OS4:>
Generates 20 characters plus two line feed characters to display two lines of 10 characters (2*10+2=22)and prints the text with the "TYPE" shell command.

Example 3:

3.OS4:> MOUNT RANDOM: QUIET
3.OS4:> TYPE "RANDOM:TEXT/SIZE=32" HEX
0000: 46535139 6B444B39 46747A53 36304E78 FSQ9kDK9FtzS60Nx
0010: 446D4534 53374D42 4A61554A 75685165 DmE4S7MBJaUJuhQe
3.OS4:>
Generates 32 characters and prints the data with the "TYPE" shell command in HEX mode.

Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it.


Copyright 2005 Amiga Auckland Inc. All rights reserved.
Revised: December 15, 2005.