N-Gens

N-Gens (beta)

This site is dedicated to the orderly disbursement of natural numbers. Our goal is to provide, for every request, a response that includes a unique, non-empty, interval of natural numbers.

Why

Why does this site exist? The idea behind this site is to:

Usage

Try the Fountain of Integers.

Simple request:

Request:
   http://www.n-gens.com/unsigned/<X>
   X: Default=1; Max=100000 

Response:
   { 
      "request_size": "<X>", 
      "number": "<Y>" 
   }

   Where:
      The response represents the interval [<Y>, <Y> + <X> - 1].

Example:
   http://www.n-gens.com/unsigned/10

   Returns:
      { 
         "request_size": "10", 
         "number": "20000000000000000000000100300038" 
      }
Try it out: http://n-gens.com/unsigned/10.

Cryptographically signed request:

Request:
   http://www.n-gens.com/signed/<X>
   X: Default=1; Max=100000 

Response:
   {
      "plaintext": "<P>", 
      "signature": "<S>" 
   }

   Where:
      P: The plaintext to be signed: 
            {
               "domain_name": "<D>", 
               "version": "<V>", 
               "request_size": "<X>", 
               "number": "<Y>"
            } 
      S: Digital signature of <P>.

   and:

      D: Domain name of the service.
      V: Version of the service key.
      X and Y: Represent the interval [<Y>, <Y> + <X> - 1].

Example:
   http://www.n-gens.com/signed/

   Returns: 
      {
         "plaintext": "{\"domain_name\": \"n-gens.com\", \"version\": \"3.3\", \"request_size\": \"1\", \"number\": \"20000000000000000000009146734169\"}",
         "signature": "Z7maE2lqMqPOZ2ag/BL162fVb+q63DxbljbwoRiAV9bN82x1fTwr4nEJ1tqgO/x0QCDqHJsuso6zHwoPoNNnmk5m9jenCntL3hfAjZP8WKEtHb21hukjzhGKbfRhppnrDayiXGbdmudrZTKbU6JK4f6srUbnUlDR2FIkFpgX/xW5HahX/fiW3BUYuKQ3NvBPZzyT5AbhvvuesGxLXxjIl2Jq5Z3qv576vm1BXKoyf2ORUD5aRZ87Tf8q0ej04dcNIwhDIzmK8z4ePiVjIUrkf4P3srBcUzCrtu+YoIRLpYgNt52SHwxsqyU8djQvBS95tJVo4UKjOOJ8509NpEcl4g=="
      }
Try it out: http://n-gens.com/signed/10.

Public signing key:

Request:
   https://www.n-gens.com/publickey/<V>
   V: Default: current version

Response:
   {
      "version": "<V>",
      "pubkey": "<K>",
      "signing_algorithm": "<S>",
      "hashing_algorithm": "<H>"
   }

   Where:
      V: Version of the service key.
      K: Public signing key of version <V>.
      S: Signing algorithm used to sign the response.
      H: Hashing algorithm used to create the response digest.

Example:
   https://www.n-gens.com/publickey

   Returns:
   {
      "version": "3.3",
      "pubkey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt35ukAQmdXkIrcydLD72\n98xdifJ2ufW42YolF7q1c9KcgN5JRxXyPI3+HvcKAwZRY6QuV1MYbiAcsd4XSSTp\nTmEY+EtAlJ6kBBs3cv9c4NZKYKHHWE25c7rWZNG7d0GDlKbK5KeBwzrS0J0AGq5Z\nJEdaMuqQ20YMl1xn3aGBTXOZGmbov0Jhcz8eovuq1vVZ1z0hs2ciRd5VaRs1ISPp\n04U0htvin3TraZzdhHw1yeUUceMEAA4WThiaaNG4w73drmmQ8HmUZj7huk+jxCxF\nPSHaPkbAw+3DVT6lwxx0W/EGwjP1d23GuRhUJpIe7VUnzkfUdJqOx46N38H/0JRY\nKwIDAQAB\n-----END PUBLIC KEY-----",
      "signing_algorithm": "RSASSA-PKCS1-v1_5",
      "hashing_algorithm": "SHA256"
   }
Try it out: https://n-gens.com/publickey.

Verification:

Example code: