php,c# hamsha1
来源:互联网 发布:二次元背景拍照软件 编辑:程序博客网 时间:2024/04/30 12:17
#!/usr/bin/php<?phpprint strtoupper(hash_hmac("sha256", "message", "key"));?>
C#
using System;using System.Text;using System.Security.Cryptography;public class Program{ private const string key = "key"; private const string message = "message"; private static readonly Encoding encoding = Encoding.UTF8; static void Main(string[] args) { var keyByte = encoding.GetBytes(key); using (var hmacsha256 = new HMACSHA256(keyByte)) { hmacsha256.ComputeHash(encoding.GetBytes(message)); Console.WriteLine("Result: {0}", ByteToString(hmacsha256.Hash)); } } static string ByteToString(byte[] buff) { string sbinary = ""; for (int i = 0; i < buff.Length; i++) sbinary += buff[i].ToString("X2"); /* hex format */ return sbinary; } }
结果相同都是
6E9EF29B75FFFC5B7ABAE527D58FDADB2FE42E7219011976917343065F58ED4A
0 0
- php,c# hamsha1
- PHP 调用 C# dll
- C# 调用PHP WebService
- PHP 调用C# WebService
- c# php des
- C#转PHP,为什么?
- C# D2010调用PHP SOAP
- PHP SOAP服务器端C#客户端
- c# java php环境安装
- c#访问php 小知识
- PHP与C# Socket通信
- PHP访问C#建立的Webservice
- timestamp php 和c#中的转换
- C#与PHP之间SOAP压缩通讯
- 用c#实现php的pack方法
- php调用C#的Web Service
- c# .net 调用php 的webservice接口
- dea_des ecb模式 java php c#实现
- js实现懒加载
- Nodejs异步流程控制Async
- Markdown简明教程
- POJ1107 W's Cipher 简单模拟
- 优化MyBatis配置文件中的配置
- php,c# hamsha1
- iOS AFN2.0请求封装使用
- Dubbo与Zookeeper、SpringMVC整合和使用(负载均衡、容错)
- 设计模式C++实现--策略模式
- linux下diff多个目录的脚本
- Method Swizzling
- 深入浅出REST
- 随机数、随机函数、大数随机及等概率探讨
- iOS AsyncSocket封装、长连接