指定された文字列に対して256ビットの文字列出力を可能にするハッシュ関数(できれば実装)を教えてください。
事前にどうもありがとうございました
MessageDigest md = MessageDigest.getInstance("SHA-256"); //make sure it exists, there are other algorithms, but I prefer SHA for simple and relatively quick hashing
String strToEncode = "Hello world";
md.update(strToEncode.getBytes("UTF-8")); //I'd rather specify the encoding. It's platform dependent otherwise.
byte[] digestBuff = md.digest();
digestBuffには、消化されたバイトが含まれます。