package com.iizix.totp;

import com.iizix.Utilities;

public class Utils
{
  // Class not meant to be instantiated
  private Utils()
    {
    }

  /**
   * Given the raw data of an image and the mime type, returns a data URI string
   * representing the image for embedding in HTML/CSS.
   *
   * @param data
   *          The raw bytes of the image.
   * @param mimeType
   *          The mime type of the image.
   * @return The data URI string representing the image.
   */
  public static String getDataUriForImage(byte [] data,String mimeType)
    {
    return "data:"+mimeType+";base64,"+Utilities.encodeBase64(data);
    }
}
