类 SecureRandomSessionIdGenerator

java.lang.Object
cn.taketoday.session.SecureRandomSessionIdGenerator
所有已实现的接口:
SessionIdGenerator

public class SecureRandomSessionIdGenerator extends Object implements SessionIdGenerator
A SessionIdGenerator that uses a secure random to generate a session ID. On some systems this may perform poorly if not enough entropy is available, depending on the algorithm in use.
从以下版本开始:
4.0 2022/4/30 23:29
作者:
Harry Yang
  • 字段详细资料

    • random

      private final SecureRandom random
    • length

      private int length
    • SESSION_ID_ALPHABET

      private static final char[] SESSION_ID_ALPHABET
    • ALPHABET_PROPERTY

      private static final String ALPHABET_PROPERTY
      另请参阅:
  • 构造器详细资料

    • SecureRandomSessionIdGenerator

      public SecureRandomSessionIdGenerator()
  • 方法详细资料

    • generateId

      public String generateId()
      从接口复制的说明: SessionIdGenerator
      Generate a new identifier.
      指定者:
      generateId 在接口中 SessionIdGenerator
      返回:
      the generated identifier
    • setSessionIdLength

      public void setSessionIdLength(int length)
      set session id length
    • encode

      private char[] encode(byte[] data)
      Encode the bytes into a String with a slightly modified Base64-algorithm This code was written by Kevin Kelley kelley@ruralnet.net and adapted by Thomas Peuss jboss@peuss.de
      参数:
      data - The bytes you want to encode
      返回:
      the encoded String