Skip to content
main
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 

README.md

Anemonis.RandomOrg

RANDOM.ORG service client based on Core API (Release 3).

Release Current
Artifacts
Code Health
Build Status

Project Details

Category Method Support
Core getUsage ✔️
Basic generateIntegers ✔️
Basic generateIntegerSequences ✔️
Basic generateDecimalFractions ✔️
Basic generateGaussians ✔️
Basic generateStrings ✔️
Basic generateUUIDs ✔️
Basic generateBlobs ✔️
Signed generateSignedIntegers ✔️
Signed generateSignedIntegerSequences ✔️
Signed generateSignedDecimalFractions ✔️
Signed generateSignedGaussians ✔️
Signed generateSignedStrings ✔️
Signed generateSignedUUIDs ✔️
Signed generateSignedBlobs ✔️
Signed getResult ✖️
Signed verifySignature ✔️
Signed createTickets ✖️
Signed listTickets ✖️
Signed getTicket ✖️
  • The client supports only string as the type for an optional user data parameter.
  • The client uses only base64 as a BLOB format in JSON.
  • The client uses only 10 as a base for integers in JSON.
  • The client doesn't support working with tickets in Signed API.

Code Examples

var client = new RandomOrgClient("YOUR_API_KEY_HERE");

// Generate an integer from the [0,10] range w/o replacement
var bin = await client.GenerateIntegersAsync(1, 0, 10, false);
// Generate a decimal fraction with 8 decimal places w/o replacement
var bdf = await client.GenerateDecimalFractionsAsync(1, 8, false);
// Generate a number from a Gaussian distribution with mean of 0.0,
// standard deviation of 1.0, and 8 significant digits
var bgs = await client.GenerateGaussiansAsync(1, 0.0m, 1.0m, 8);
// Generate a string with length of 8 from the specified letters w/o replacement
var bst = await client.GenerateStringsAsync(1, 8, "abcdef", false);
// Generate an UUID of version 4
var bud = await client.GenerateUuidsAsync(1);
// Generate a BLOB with length of 8 bytes
var bbl = await client.GenerateBlobsAsync(1, 8);
// Generate an integer from the [0,10] range w/o replacement with signature
var sin = await client.GenerateSignedIntegersAsync(1, 0, 10, false);
// Verify the signature of the previously generated random integer
var ain = await client.VerifySignatureAsync(sin.Random, sin.GetSignature());
// Get usage information of the current API key
var usg = await client.GetUsageAsync();

Console.WriteLine("Random integer: " + bin.Random.Data[0]);
Console.WriteLine("Random decimal fraction: " + bdf.Random.Data[0]);
Console.WriteLine("Random Gaussian number: " + bgs.Random.Data[0]);
Console.WriteLine("Random string: " + bst.Random.Data[0]);
Console.WriteLine("Random UUID: " + bud.Random.Data[0]);
Console.WriteLine("Random BLOB: " + Convert.ToBase64String(bbl.Random.Data[0]));
Console.WriteLine("Signed data is authentic: " + ain);
Console.WriteLine("Daily quota requests left: " + usg.RequestsLeft);

Quicklinks