splitting a base64 encoded variable in two

I need to split my val ‘ha’ in two before making a request. Can this be done something like this?

`

val ha = new sun.misc.BASE64Encoder().encode(md.digest( str.getBytes))

val MAC = ha.substring(0, ha.length() / 2 )

`

This is more of a scala programming question, but maybe someone has done this before and can help me?

I found this ‘splitting’ to work as well!