# NAME

NIST::Beacon - A Perl module for querying NIST's randomness beacon.

# VERSION

version 1.002

# SYNOPSIS

        use NIST::Beacon;

        my $beacon = NIST::Beacon->new;
        my $record = $beacon->latest_record;

        print "The latest sequence generated by the NIST beacon is: \n";
        print $record->current, "\n";

# DESCRIPTION

NIST::Beacon provides a perl interface to the REST API of the [NIST randomness beacon](https://beacon.nist.gov/home).

## Methods

- `latest_record`

    Returns a [NIST::Beacon::Record](https://metacpan.org/pod/NIST::Beacon::Record) object containing the latest record
    emitted by the NIST beacon.
    Returns `undef` if a network failure occurs.

- `previous_record(timestamp)`

    Returns a [NIST::Beacon::Record](https://metacpan.org/pod/NIST::Beacon::Record) object containing the record emitted
    immediately prior to the record emitted at `timestamp`.
    `timestamp` must be in Unix timestamp format. If no timestamp is given,
    the current time is assumed.
    Returns `undef` if a network failure occurs or no record exists.

- `current_record(timestamp)`

    Returns a [NIST::Beacon::Record](https://metacpan.org/pod/NIST::Beacon::Record) object containing the record emitted
    at `timestamp`. `timestamp` must be in Unix timestamp format.
    If no timestamp is given, the current time minus one minuted is assumed
    (to avoid querying a record that has not yet been generated).
    Returns `undef` if a network failure occurs or no record exists.

- `next_record(timestamp)`

    Returns a [NIST::Beacon::Record](https://metacpan.org/pod/NIST::Beacon::Record) object containing the record emitted
    immediately after the record emitted at `timestamp`.
    `timestamp` must be in Unix timestamp format. 
    Returns `undef` if no timestamp is given or if the timestamp is in the
    future.

# SEE ALSO

[NIST::Beacon::Record](https://metacpan.org/pod/NIST::Beacon::Record)

# AUTHOR

William Woodruff <william@tuffbizz.com>

# COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by William Woodruff.

This is free software, licensed under:

    The MIT (X11) License