def generate
      yield self if block_given?

      token = Token.generate(secret:  @secret,
                             message: @message,
                             iv:      @iv,
                             now:     @now)
      token.to_s
    end
def generate
      yield self if block_given?

      token = Token.generate(secret:  @secret,
                             message: @message,
                             iv:      @iv,
                             now:     @now)
      token.to_s
    end
Internal: Initializes a generator

 opts - a hash containing the following keys:
 * secret  - a string containing a secret, optionally Base64 encoded
 * message - the message
 Internal: generates a secret token

 Yields itself, useful for setting or overriding the message

 Examples

   generator = Generator.new(secret: some_secret)
   token = generator.generate do |g|
     g.message = 'this is my message'
   end

   generator = Generator.new(secret: some_secret,
                             message: 'this is my message')
   token = generator.generate

 Returns the token as a string