@ SuppressWarnings ( "PMD.AvoidArrayLoops" ) private static byte [ ] salt ( final byte [ ] text ) { final byte size = ( byte ) CcSalted . RND . nextInt ( Tv . TEN ) ; final byte [ ] output = new byte [ text . length + ( int ) size + 2 ] ; output [ 0 ] = size ; byte sum = ( byte ) 0 ; for ( int idx = 0 ; idx < ( int ) size ; ++ idx ) { output [ idx + 1 ] = ( byte ) CcSalted . RND . nextInt ( ) ; sum += output [ idx + 1 ] ; } System . arraycopy ( text , 0 , output , ( int ) size + 1 , text . length ) ; output [ output . length - 1 ] = sum ; return output ; }
Salt the string .