encodeSha256 static method

String encodeSha256(
  1. String data
)

sha256 散列计算

Implementation

static String encodeSha256(String data) {
  var content = const Utf8Encoder().convert(data);
  var digest = sha256.convert(content);
  return hex.encode(digest.bytes);
}