package com.santhosh.random;
import java.util.Random;
import org.apache.commons.lang3.StringUtils;
public class SequenceGenerator {
private final Random random;
public SequenceGenerator() {
random = new Random();
}
/**
* Returns a pseudo-random integer between 0 and n-1.
*
* @see Random#nextInt(int)
*/
public int nextInt(int n) {
return random.nextInt(n);
}
public static void main(String[] args) {
SequenceGenerator g = new SequenceGenerator();
String result = StringUtils.leftPad(String.valueOf(g.nextInt(99999)),
5, '0');
System.out.println(result);
}
}
Another Log4j Bug – DoS
Denial of Service (DoS) which is another Log4J Bug reported over the last couple of days after the fix for JNDI is provided. Apache Issues Fix and the new Log4j vulnerability is similar to Log4Shell but this DoS flaw has to do with Context Map lookups. Apache released another patch version 2.17.0 to address the…