GGYU

sha512 예제 본문

프로그래밍/JAVA

sha512 예제

GANADARA 2018. 7. 19. 21:54

 private static String getSha512(String plainText) {

        try {

            MessageDigest md = MessageDigest.getInstance("SHA-512");

            byte[] bytes = plainText.getBytes(Charset.forName("UTF-8"));

            md.update(bytes);

            return Base64.encode(md.digest());

        } catch (Exception e) {

            System.out.println("Sha512 error.");

            e.printStackTrace();

            return null;

        }

    }



'프로그래밍 > JAVA' 카테고리의 다른 글

collection sort  (0) 2018.07.19
체인코드  (0) 2018.07.19
base64 사용법  (0) 2018.07.19
서버/클라이언트 예제  (0) 2018.07.19
크리티컬섹션 처리  (0) 2018.07.19
Comments