@@ -0,0 +1,2071 @@
+package co.phoenixlab.discord.util;%0A%0Apublic class SnowflakeUtils %7B%0A%0A    public static final String CODEX = %220123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz%22;%0A    public static final int BASE = CODEX.length();%0A%0A    private SnowflakeUtils() %7B%7D%0A%0A    public static long decodeSnowflake(String encoded) %7B%0A        if (!encoded.startsWith(%22$%22)) %7B%0A            throw new IllegalArgumentException(%22Not a valid encoded snowflake: %22 + encoded);%0A        %7D%0A        encoded = encoded.substring(1);%0A        return parse(encoded);%0A    %7D%0A%0A    public static String encodeSnowflake(long snowflake) %7B%0A        return %22$%22 + encode(snowflake);%0A    %7D%0A%0A    private static long parse(String r62) %7B%0A        char%5B%5D chars = r62.toCharArray();%0A        int length = chars.length;%0A        long ret = 0;%0A        //  Read the number from right to left (smallest place to largest)%0A        //  WARNING: NO UNDER/OVERFLOW CHECKING IS DONE%0A        int lenLessOne = length - 1;%0A        for (int i = lenLessOne; i %3E= 0; i--) %7B%0A            long digit = charToDigit(chars%5Bi%5D);%0A            int placeValue = lenLessOne - i;%0A            long addnum = digit * (long) Math.pow(BASE, placeValue);%0A            ret += addnum;%0A        %7D%0A        return ret;%0A    %7D%0A%0A    private static String encode(long l) %7B%0A        long accum = l;%0A        StringBuilder builder = new StringBuilder();%0A        long remainder;%0A        while (Long.compareUnsigned(accum, 0) %3E 0) %7B%0A            long last = accum;%0A            accum = accum / BASE;%0A            remainder = last - (accum * BASE);%0A            builder.append(digitToChar(Math.abs((int) remainder)));%0A        %7D%0A        String ret = builder.reverse().toString();%0A        //  Strip leading zeros%0A        for (int i = 0; i %3C ret.length(); i++) %7B%0A            if (ret.charAt(i) != '0') %7B%0A                ret = ret.substring(i);%0A                break;%0A            %7D%0A        %7D%0A        return ret;%0A    %7D%0A%0A    private static char digitToChar(int i) %7B%0A        return CODEX.charAt(i);%0A    %7D%0A%0A    private static int charToDigit(char c) %7B%0A        return CODEX.indexOf(c);%0A    %7D%0A%0A%7D%0A

Add snowflake encoding/decoding