TrueRandomIntGenerator
From fmepedia
The transformer generates true random integer values and stores them in _random_int attribute.
The transformer takes as parameters minimum and maximum values, and base, which defines whether the output will be in binary, octal, decimal or hexadecimal represention.
This transformer uses an online service at http://random.org. Randomness is generated via atmospheric noise. See http://www.random.org/clients/http/ for details. The page http://www.random.org/quota/ contains information about quotas.
The attached workspace illustrates good and bad way of using online services.
The workspace contains two custom transformers. One sends requests with each feature passing through it. This makes the transformer work extremely slowly. Another transformer TrueRandomIntGenerator.fmx sends just one request with the first feature, which also "knows" how many features have entered the transformer. At later stage, features and random numbers are merged with FeatureMerger.
Here is a little table with the results I got on my machine:
| one request | request per feature | |
|---|---|---|
| 100 features | 1.3s | 47s |
| 1000 features | 2s | 7m 17s |
Note that the maximum number of random numbers you can get per request (one run) is 10,000.
Note also, that if you supply incorrect parameter combination, an HTTP status code 503 (Service Unavailable) will be returned. To debug the error, you can use the _url generated by the transformer in your browser, which will give you the reason for the error. I filed an enhancement PR, which will allow passing this message onto features.
For more details and examples check Using_Random.org_service.
