private char [ ] hashTheKey ( String key ) throws UnsupportedEncodingException , NoSuchAlgorithmException { MessageDigest messageDigest = MessageDigest . getInstance ( mBuilder . getDigestAlgorithm ( ) ) ; messageDigest . update ( key . getBytes ( mBuilder . getCharsetName ( ) ) ) ; return Base64 . encodeToString ( messageDigest . digest ( ) , Base64 . NO_PADDING ) . toCharArray ( ) ; }
takes in a simple string and performs an sha1 hash that is 128 bits long ... we then base64 encode it and return the char array