|
Noid is a Perl module that contains routines to mint and manage nice opaque identifiers.
SYNOPSIS
use Noid; # import routines into a Perl script
$dbreport = Noid::dbcreate( # create minter database & printable
$dbdir, $contact, # report on its properties; $contact
$template, $term, # is string identifying the operator
$naan, $naa, # (authentication information); the
$subnaa ); # report is printable$noid = Noid::dbopen( $dbname, $flags ); # open a minter, optionally
$flags = 0 | DB_RDONLY; # in read only mode
Noid::mint( $noid, $contact, $pepper ); # generate an identifier
Noid::dbclose( $noid ); # close minter when done
Noid::checkchar( $id ); # if id ends in +, replace with new check
# char and return full id, else return id
# if current check char valid, else return
# 'undef'
Noid::validate( $noid, # check that ids conform to template ("-"
$template, # means use minter's template); returns
@ids ); # array of corresponding strings, errors
# beginning with "iderr:"
$n = Noid::bind( $noid, $contact, # bind data to identifier; set
$validate, $how, # $validate to 0 if id. doesn't
$id, $elem, $value ); # need to conform to a template
Noid::note( $noid, $contact, $key, $value ); # add an internal note
Noid::fetch( $noid, $verbose, # fetch bound data; set $verbose
$id, @elems ); # to 1 to return labels
print Noid::dbinfo( $noid, # get minter information; level
$level ); # brief (default), full, or dump
Noid::getnoid( $noid, $varname ); # get arbitrary named internal
# variable
Noid::hold( $noid, $contact, # place or release hold; return
$on_off, @ids ); # 1 on success, 0 on error
Noid::hold_set( $noid, $id );
Noid::hold_release( $noid, $id );
Noid::parse_template( $template, # read template for errors, returning
$prefix, $mask, # namespace size (NOLIMIT=unbounded)
$gen_type, # or 0 on error; $message, $gen_type,
$message ); # $prefix, & $mask are output params
Noid::queue( $noid, $contact, # return strings for queue attempts
$when, @ids ); # (failures start "error:")
Noid::n2xdig( $num, $mask ); # show identifier matching ord. $num
Noid::sample( $noid, $num ); # show random ident. less than $num
Noid::scope( $noid ); # show range of ids inside the minter
print Noid::errmsg( $noid, $reset ); # print message from failed call
$reset = undef | 1; # use 1 to clear error message buffer
Noid::addmsg( $noid, $message ); # add message to error message buffer
Noid::logmsg( $noid, $message ); # write message to minter log
Requirements:
· Perl
Download
|
|