docs: function TokenGenerator( structure ) {
  	var i , element ;
  
  	this.structure = structure ;
  	this.byteLength = 0 ;
  
  	if ( ! Array.isArray( structure ) ) {
  		throw new TypeError( '[token-kit] .createTokenGenerator(), argument #0: bad token structure, it should be an Array of Object' ) ;
  	}
  
  	for ( i = 0 ; i < structure.length ; i ++ ) {
  		element = structure[ i ] ;
  
  		if ( ! element || typeof element !== 'object' ) {
  			throw new TypeError( '[token-kit] .createTokenGenerator(), argument#0: bad token structure, it should be an Array of Object' ) ;
  		}
  
  		switch ( element.type ) {
  			case 'random' :
  				element.genType = 'uint' ;
  				element.decodeType = 'base64url' ;
  				element.auto = element.type ;
  				break ;
  			case 'timestamp' :
  				element.genType = element.decodeType = 'int' ;
  				if ( ! element.length ) { element.length = 6 ; }
  				element.auto = element.type ;
  				break ;
  			case 'increment8' :
  				element.genType = element.decodeType = 'uint' ;
  				element.length = 1 ;
  				element.auto = element.type ;
  				break ;
  			case 'increment16' :
  				element.genType = element.decodeType = 'uint' ;
  				element.length = 2 ;
  				element.auto = element.type ;
  				break ;
  			case 'increment24' :
  				element.genType = element.decodeType = 'uint' ;
  				element.length = 3 ;
  				element.auto = element.type ;
  				break ;
  			case 'increment32' :
  				element.genType = element.decodeType = 'uint' ;
  				element.length = 4 ;
  				element.auto = element.type ;
  				break ;
  			default :
  				element.genType = element.decodeType = element.type ;
  				element.auto = null ;
  		}
  
  		if ( typeof element.length !== 'number' || element.length !== Math.floor( element.length ) || element.length < 1 ) {
  			throw new TypeError( "[token-kit] .createTokenGenerator(), argument#0: bad token structure, it should be an Array of Object, having a 'length' property (positive integer)" ) ;
  		}
  
  		switch ( element.genType ) {
  			case 'int' :
  			case 'uint' :
  				if ( element.length > 6 ) {
  					throw new TypeError( "[token-kit] .createTokenGenerator(), 'length' property is too big (max 6 bytes for integer)" ) ;
  				}
  				break ;
  			case 'BASE36' :
  			case 'string' :
  			case 'hex' :
  			case 'buffer' :
  				break ;
  			default :
  				throw new TypeError( "[token-kit] .createTokenGenerator(), unknown type: " + element.genType ) ;
  		}
  
  		this.byteLength += element.length ;
  	}
  
  	this.tokenLength = Math.ceil( this.byteLength * 4 / 3 ) ;	// Base64: 33% of overhead
  	//console.log( "byteLength:" , this.byteLength , " tokenLength:" , this.tokenLength ) ;
  	this.buffer = new Uint8Array( this.byteLength ) ;
  }