<?xml version="1.0" encoding="UTF-8"?>
<!--

random.org YQL json api.

Usage: via urls like this (remove linebreaks and whitespace):

  https://query.yahooapis.com/v1/public/yql
    ?q=use%22http://davidbau.com/encode/srandom.xml%22;
      select*from%20srandom%20where%20nbytes%3D@nbytes;
    &format=json
    &diagnostics=false
    &callback=Math.seedrandom
    &nbytes=1024

  (This is also http://bit.ly/srandom-1024 - there are also
  similar urls at http://bit.ly/srandom-256 etc)

  nbytes = The number of bytes (8 bits each) of randomness.

  response.results.data will end up being a string of hex digits.
    The number of hexidecimal digits in the response will be
    twice nbytes.

-->

<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
 <meta>
  <sampleQuery>select * from {table} where nbytes=1024</sampleQuery>
 </meta>
 <bindings>
  <select itemPath="" produces="XML">
   <urls>
    <url>http://www.random.org/cgi-bin/randbyte?format=h</url>
   </urls>
   <inputs>
    <key id='nbytes' type='xs:integer' paramType='query' required="true" />
   </inputs>
   <execute><![CDATA[
    // Your server-side javascript goes here
    request.header('Cache-Control', 'no-cache');
    data = request.get().response.replace(/\s+/g, '');
    response.object = <data>{data}</data>;
   ]]></execute>
  </select>
 </bindings>
</table>
