SHA-256 加密 php 有相关的函数吗?

SHA-256 加密 php 有相关的函数吗


繁星coding
浏览 2051回答 3
3回答

慕丝7291255

import java.security.MessageDigest;public class Test{public static void main(String[] args) {String t= "abcd";try {MessageDigest md = MessageDigest.getInstance("SHA-256");md.update(t.getBytes("GBK"));for(byte b:md.digest())System.out.format("%02X",b);} catch (Exception e) {e.printStackTrace();}}}=========88D4266FD4E6338D13B845FCF289579D209C897823B9217DA3E161936F031589PHP验证<?phpecho hash('sha256', 'abcd');88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031589验证无误
打开App,查看更多内容
随时随地看视频慕课网APP