Class BaseNRemainderDecoder

  • All Implemented Interfaces:
    Function<String,​UUID>

    public final class BaseNRemainderDecoder
    extends BaseNDecoder
    Function that decodes a base-n string to a UUID.

    It decodes strings created by encoders that use remainder operator (modulus), a common approach to encode integers.

    The decoding process is performed using integer arithmetic.

    • Constructor Detail

      • BaseNRemainderDecoder

        public BaseNRemainderDecoder​(BaseN base)
        Constructor with a base-n.
        Parameters:
        base - a base-n
    • Method Detail

      • multiply

        protected static long[] multiply​(long x,
                                         long multiplier,
                                         long rem)
        Multiply a long as unsigned 64 bit integer
        Parameters:
        x - a number to be multiplied
        multiplier - a multiplier
        rem - the reminder
        Returns:
        an array of longs