net.i2p.imagegen

## Class IdenticonServlet

- java.lang.Object
- - javax.servlet.GenericServlet
  - - javax.servlet.http.HttpServlet
    - - net.i2p.imagegen.IdenticonServlet

- All Implemented Interfaces:
    Serializable, Servlet, ServletConfig

      public class IdenticonServlet
      extends HttpServlet

  This servlet generates identicon (visual identifier) images ranging from 16x16 to 512x512 in size.

  ## Supported Image Formats

  Currently only PNG is supported because `javax.imageio` package does not come with built-in GIF encoder and PNG is the only remaining reasonable format.

  ## Initialization Parameters:

  > inetSalt
  >   salt used to generate identicon code with. must be fairly long. (Required)
  > cacheProvider
  >   full class path to `IdenticonCache` implementation. (Optional)

  ## Request ParametersP

  > code
  >   identicon code to render. If missing, requester's IP addresses is used to generated one. (Optional)
  > size
  >   identicon size in pixels. If missing, a 16x16 pixels identicon is returned. Minimum size is 16 and maximum is 64. (Optional)

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `IdenticonServlet()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doGet(HttpServletRequest request, HttpServletResponse response)`
    `void` | `init(ServletConfig cfg)`

    - ### Methods inherited from class javax.servlet.http.HttpServlet

      `doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service`

    - ### Methods inherited from class javax.servlet.GenericServlet

      `destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### IdenticonServlet

          public IdenticonServlet()

  - ### Method Detail

    - #### doGet

          protected void doGet(HttpServletRequest request,
                               HttpServletResponse response)
                        throws ServletException,
                               IOException

      Overrides:
        `doGet` in class `HttpServlet`
      Throws:
        `ServletException`
        `IOException`

    - #### init

          public void init(ServletConfig cfg)
                    throws ServletException

      Specified by:
        `init` in interface `Servlet`
      Overrides:
        `init` in class `GenericServlet`
      Throws:
        `ServletException`