package com.tb.tb_lib.l; import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import kotlin.UByte; public class m { public static String a(String str) { try { MessageDigest instance = MessageDigest.getInstance("SHA-256"); instance.update(str.getBytes("UTF-8")); return a(instance.digest()); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e2) { e2.printStackTrace(); } return ""; } private static String a(byte[] bArr) { StringBuffer stringBuffer = new StringBuffer(); for (byte b : bArr) { String hexString = Integer.toHexString(b & UByte.MAX_VALUE); if (hexString.length() == 1) { stringBuffer.append("0"); } stringBuffer.append(hexString); } return stringBuffer.toString(); } }