Exemple #1
0
  public static void main(String[] args) throws Exception {

    String id = LinkEncrypt.generateToken("123");
    System.out.println(id);
    String userId = LinkEncrypt.getUserIdByToken(id);
    System.out.println(userId);
  }
Exemple #2
0
 public static String getUserIdByToken(String token) throws IOException {
   String[] keys = LinkEncrypt.unToken(token);
   if (null != keys && keys.length == 3) {
     return keys[2];
   }
   return null;
 }