Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <div class="container">
  <h1>Lottery Verifier</h1>
  <form>
    <div class="form-group">
      <label for="serverSeed">Server Seed</label>
      <input id="serverSeed" type="text" class="form-control">
    </div>
    <div class="form-group">
      <label for="clientSeed">Client Seed</label>
      <input id="clientSeed" type="text"  class="form-control">
    </div>
    <div class="form-group">
      <label for="nonce">Nonce</label>
      <input id="nonce" type="text" class="form-control">
    </div>
    <hr>
    <div class="form-group">
      <label for="serverSeedHash">Server Seed (Hashed)</label>
      <input id="serverSeedHash" type="text" class="form-control" disabled>
    </div>
    <div class="form-group">
      <label for="numbers">Numbers</label>
      <input id="numbers" type="text" class="form-control" disabled>
    </div>
    <div class="form-group">
      <label for="jackpotNumber">Jackpot Number</label>
      <input id="jackpotNumber" type="text" class="form-control" disabled>
    </div>
  </form>
</div>
            
          
!

CSS

            
              
            
          
!

JS

            
              var url = $.url(document.location.href);
var minNumber = parseInt(url.param('minNumber') || '1', 10)
var maxNumber = parseInt(url.param('maxNumber') || '36', 10)
var minJackpotNumber = parseInt(url.param('minJackpotNumber') || '1', 10)
var maxJackpotNumber = parseInt(url.param('maxJackpotNumber') || '10', 10)

function getNumber(serverSeed, clientSeed, nonce, min, max) {
  var hash = sha512(serverSeed + clientSeed + nonce);

  var index = 0;
  do {
    var lucky = parseInt(hash.substr(index, 3), 16);
    index += 3;
  } while (lucky >= 4000);
  
  return min + (lucky % (max - min + 1));
}

function getNumbers(serverSeed, clientSeed, currentNonce, maxNonce, min, max) {
  var numbers = [];
  
  while (currentNonce <= maxNonce) {
    var number = getNumber(serverSeed, clientSeed, currentNonce++, min, max);
    
    if (-1 === numbers.indexOf(number)) {
      numbers.push(number);
    }
  }
  
  return numbers;
}

var $serverSeed = $('#serverSeed');
var $clientSeed = $('#clientSeed');
var $nonce = $('#nonce');
var $serverSeedHash = $('#serverSeedHash');
var $numbers = $('#numbers');
var $jackpotNumber = $('#jackpotNumber');

$serverSeed.val(url.param('serverSeed'));
$clientSeed.val(url.param('clientSeed'));
$nonce.val(url.param('nonce'));

$('form').keyup(function() {
  var serverSeed = $serverSeed.val();
  var clientSeed = $clientSeed.val();
  var nonce = $nonce.val();

  $serverSeedHash.val(serverSeed ? sha256(serverSeed) : '<Empty Server Seed>');
  
  if (!serverSeed) {
    $numbers.val('<Empty Server Seed>');
    $jackpotNumber.val('<Empty Server Seed>');
  } else if (!clientSeed) {
    $numbers.val('<Empty Client Seed>');
    $jackpotNumber.val('<Empty Client Seed>');
  } else if (nonce === '') {
    $numbers.val('<Empty Nonce>');
    $jackpotNumber.val('<Empty Nonce>');
  } else {
    $numbers.val(getNumbers(serverSeed, clientSeed, 1, nonce - 1, minNumber, maxNumber).join(', '));
    $jackpotNumber.val(getNumbers(serverSeed, clientSeed, nonce, nonce, minJackpotNumber, maxJackpotNumber).join(', '));
  }
}).keyup();
            
          
!
999px

Console