示例#1
0
 /**
  * return a hash of a given secret if any.
  *
  * @param secret
  * @return
  */
 public String hash(String secret) {
   return Codecs.encodeBase64(
       Digests.sha2(settings.cryptoHashSalt(), Codecs.toBytes(secret)), false);
 }
示例#2
0
 /** @param settings */
 public CredentialsCrypto(AccountSettings settings) {
   this.settings = settings;
   this.keyHash = Digests.sha2(Codecs.toBytes(settings.cryptoKeySeed()));
 }