package ru.otus.mobile.util;

import java.security.SecureRandom;
import java.time.Instant;

public final class TestData {
    private static final SecureRandom RANDOM = new SecureRandom();

    private TestData() {
    }

    public static String uniqueName(String prefix) {
        long ts = Instant.now().getEpochSecond();
        int rnd = RANDOM.nextInt(36 * 36);
        String tsPart = Long.toString(ts, 36);
        String rndPart = String.format("%2s", Integer.toString(rnd, 36)).replace(' ', '0');
        return prefix + "-" + tsPart + rndPart;
    }
}
