// Path: fauxflake-core/src/main/java/com/github/rholder/fauxflake/api/EncodingProvider.java
// public interface EncodingProvider {
// 
//     /**
//      * Return a raw byte encoding of the given time and sequence number.
//      *
//      * @param time      a time value to encode
//      * @param sequence  a sequence value to encode
//      */
//     public byte[] encodeAsBytes(long time, int sequence);
// 
//     /**
//      * Return a Long encoding of the given the time and sequence number.
//      *
//      * @param time      a time value to encode
//      * @param sequence  a sequence value to encode
//      */
//     public long encodeAsLong(long time, int sequence);
// 
//     /**
//      * Return a String encoding of the given the time and sequence number.
//      *
//      * @param time      a time value to encode
//      * @param sequence  a sequence value to encode
//      */
//     public String encodeAsString(long time, int sequence);
// 
//     /**
//      * Return the maximum number of sequence numbers that can be encoded for a
//      * given time by this implementation.
//      */
//     public int maxSequenceNumbers();
// }
// 
// Path: fauxflake-core/src/main/java/com/github/rholder/fauxflake/util/StringUtils.java
// public static String leftPad(String str, int size) {
//     return leftPad(str, size, ' ');
// }


import com.github.rholder.fauxflake.api.EncodingProvider;
import static com.github.rholder.fauxflake.util.StringUtils.leftPad;
import static java.lang.Long.toHexString;
    }

    @Override
    public byte[] encodeAsBytes(long time, int sequence) {
        long v =  ((time - EPOCH) << SHIFT_TIME_BITS) | shiftedMachineId | sequence;

        byte[] buffer = new byte[8];
        buffer[0] = (byte)(v >>> 56);
        buffer[1] = (byte)(v >>> 48);
        buffer[2] = (byte)(v >>> 40);
        buffer[3] = (byte)(v >>> 32);
        buffer[4] = (byte)(v >>> 24);
        buffer[5] = (byte)(v >>> 16);
        buffer[6] = (byte)(v >>>  8);
        buffer[7] = (byte)(v);

        return buffer;
    }

    @Override
    public long encodeAsLong(long time, int sequence) {
        return ((time - EPOCH) << SHIFT_TIME_BITS) | shiftedMachineId | sequence;
    }

    /**
     * Return the 16 character left padded hex version of the given id. These
     * can be lexicographically sorted.
     */
    @Override
    public String encodeAsString(long time, int sequence) {
// Path: fauxflake-core/src/main/java/com/github/rholder/fauxflake/api/EncodingProvider.java
// public interface EncodingProvider {
// 
//     /**
//      * Return a raw byte encoding of the given time and sequence number.
//      *
//      * @param time      a time value to encode
//      * @param sequence  a sequence value to encode
//      */
//     public byte[] encodeAsBytes(long time, int sequence);
// 
//     /**
//      * Return a Long encoding of the given the time and sequence number.
//      *
//      * @param time      a time value to encode
//      * @param sequence  a sequence value to encode
//      */
//     public long encodeAsLong(long time, int sequence);
// 
//     /**
//      * Return a String encoding of the given the time and sequence number.
//      *
//      * @param time      a time value to encode
//      * @param sequence  a sequence value to encode
//      */
//     public String encodeAsString(long time, int sequence);
// 
//     /**
//      * Return the maximum number of sequence numbers that can be encoded for a
//      * given time by this implementation.
//      */
//     public int maxSequenceNumbers();
// }
// 
// Path: fauxflake-core/src/main/java/com/github/rholder/fauxflake/util/StringUtils.java
// public static String leftPad(String str, int size) {
//     return leftPad(str, size, ' ');
// }


// Path: fauxflake-core/src/main/java/com/github/rholder/fauxflake/provider/twitter/SnowflakeEncodingProvider.java
import com.github.rholder.fauxflake.api.EncodingProvider;
import static com.github.rholder.fauxflake.util.StringUtils.leftPad;
import static java.lang.Long.toHexString;

    }

    @Override
    public byte[] encodeAsBytes(long time, int sequence) {
        long v =  ((time - EPOCH) << SHIFT_TIME_BITS) | shiftedMachineId | sequence;

        byte[] buffer = new byte[8];
        buffer[0] = (byte)(v >>> 56);
        buffer[1] = (byte)(v >>> 48);
        buffer[2] = (byte)(v >>> 40);
        buffer[3] = (byte)(v >>> 32);
        buffer[4] = (byte)(v >>> 24);
        buffer[5] = (byte)(v >>> 16);
        buffer[6] = (byte)(v >>>  8);
        buffer[7] = (byte)(v);

        return buffer;
    }

    @Override
    public long encodeAsLong(long time, int sequence) {
        return ((time - EPOCH) << SHIFT_TIME_BITS) | shiftedMachineId | sequence;
    }

    /**
     * Return the 16 character left padded hex version of the given id. These
     * can be lexicographically sorted.
     */
    @Override
    public String encodeAsString(long time, int sequence) {
        return leftPad(toHexString(encodeAsLong(time, sequence)), 16, '0');