question: public static String hash ( String string ) { try { MessageDigest sha1 = MessageDigest . getInstance ( "SHA-1" ) ; sha1 . update ( string . getBytes ( "UTF-8" ) ) ; return Base64 . encode ( sha1 . digest ( ) ) ; } catch ( Exception ex ) { Debug debug = Debug . getInstance ( "amSDK" ) ; if ( debug . warningEnabled ( ) ) { debug . warning ( "Hash.hash:" , ex ) ; } return null ; } }
target:  Generates a SHA1 digest of the string and returns BASE64 encoded digest.