code: public static byte[] sha256Bytes(String str) {
          if (str == null) return null;
          MessageDigest digester;
          try {
              digester = MessageDigest.getInstance("SHA-256");
          } catch (NoSuchAlgorithmException ex) {
              throw new RuntimeException(ex);
          }
          return digester.digest(str.getBytes());
      }
docs: SHA-256
  
  @param str 待hash数据
  
  @return hash值