package eu.mhsl.minenet.minigames.util;

import java.util.UUID;

public class UuidUtil {
    public static UUID unTrimm(String trimmedUuid) {
        StringBuilder builder = new StringBuilder(trimmedUuid.trim());
        try {
            builder.insert(20, "-");
            builder.insert(16, "-");
            builder.insert(12, "-");
            builder.insert(8, "-");
        } catch (StringIndexOutOfBoundsException e) {
            throw new IllegalArgumentException();
        }
        return UUID.fromString(builder.toString());
    }
}
