[crypto.random.int]

crypto.random.int is a slot in the crypto namespace, in Hyperlambda, the language of Magic Cloud. Returns a cryptographically secure random integer; use the optional [max] to cap the upper bound.

  • Returns: Resolves to a random integer less than the optional [max] value

Arguments

Required arguments come first, then the optional ones in the order they are declared.

Argument Type Required Description
[max] int no Exclusive maximum integer. Default: int.MaxValue.
[seed] string no Optional deterministic seed.

Guide: How to use [crypto.random.int]

JSON declaration

This is the complete declaration of crypto.random.int, as the running system describes it. It is also published as slot.json.

JSON declaration
{
  "name": "crypto.random.int",
  "description": "Returns a cryptographically secure random integer; use the optional [max] to cap the upper bound",
  "signature": {
    "children": {
      "max": {
        "type": "int",
        "description": "Exclusive maximum integer",
        "required": false,
        "mode": "ValueOrExpression",
        "cardinality": "ZeroOrOne",
        "default": "int.MaxValue",
        "role": "Option",
        "projection": "Value"
      },
      "seed": {
        "type": "string",
        "kind": "crypto-seed",
        "description": "Optional deterministic seed",
        "required": false,
        "mode": "ValueOrExpression",
        "cardinality": "ZeroOrOne",
        "role": "Option",
        "projection": "Value"
      }
    },
    "output": {
      "mode": "Value",
      "kind": "random-number,integer,number",
      "description": "Resolves to a random integer less than the optional [max] value"
    }
  }
}

← crypto.random all crypto.* slots crypto.rsa.create-key →