private static StringBuilder toBase64 ( long value ) { StringBuilder result = new StringBuilder ( 23 ) ; // Initialize with the size of ID if using Base64 for ( int shift = 60 ; shift >= 0 ; shift -= 6 ) { result . append ( Base64 [ ( int ) ( ( value >> shift ) & 0x3F ) ] ) ; } return result ; }
Return 11 chars of Base64 string for the 64 bits of the value padded with 2 zero bits