/** * Instantiates a new base metrics impl. * * @param aBase the base * @param aCharSet the char set */ public BaseMetricsImpl( int aBase, char[] aCharSet ) { this( aBase, aCharSet, Padding.BASE64.getChar() ); }
/** * Instantiates a new base metrics impl. * * @param aBase the base * @param aBitsPerDigit the bits per digit * @param aDigitsPerByte the digits per byte * @param aDigitsPerInt the digits per int * @param aBytesPerInt the bytes per int * @param aCharSet the char set */ public BaseMetricsImpl( int aBase, int aBitsPerDigit, int aDigitsPerByte, int aDigitsPerInt, int aBytesPerInt, char[] aCharSet ) { this( aBase, aBitsPerDigit, aDigitsPerByte, aDigitsPerInt, aBytesPerInt, aCharSet, Padding.BASE64.getChar() ); }
String thePrefix = null; thePrefix = Base64.getEncoder().encodeToString( IP_ADDRESS ); thePrefix = thePrefix.replaceAll( Padding.BASE64.getChar() + "", "" ); if ( _idLength <= thePrefix.length() ) { throw new IllegalStateException( "The desired length of <" + _idLength + "> is too short as the prefix \"" + thePrefix + "\" has already a length of <" + thePrefix.length() ); String theTimeString = null; theTimeString = Base64.getEncoder().encodeToString( NumericalUtility.toBytes( theTime ) ); theTimeString = theTimeString.replaceAll( Padding.BASE64.getChar() + "", "" ); String theSeedString = null; while ( theSeedString == null || theSeedString.length() == 0 ) { theSeedString = Base64.getEncoder().encodeToString( NumericalUtility.toBytes( SEED++ ) ); theSeedString = theSeedString.replaceAll( Padding.BASE64.getChar() + "", "" ); if ( theSeedString == null || theSeedString.length() == 0 ) { initSeed(); theCounterString = theCounterString.replaceAll( Padding.BASE64.getChar() + "", "" ); if ( theCounterString.length() != theRemainingLength ) { if ( theCounterString.length() > theRemainingLength ) {