Verotel需要使用sha1_hex函数对一些数据进行散列.究竟是什么?在整个互联网上没有关于它的信息.他们说“使用SHA-1哈希(十六进制输出)”. Sha1有十六进制输出?
下面是一个我似乎无法再现的例子:
sha1_hex(“abc777X:description=some description of product:priceAmount=51.20:priceCurrency=EUR:shopID=60678:version=1”)
= 04d87d2718767ea0bef259c436ec63e3cde05be2
解决方法
echo sha1('abc777X:description=some description of product:priceAmount=51.20:priceCurrency=EUR:shopID=60678:version=1');
实际上,sha1_hex在PHP中被命名为sha1().这是一个例子,处理您的输入:http://codepad.org/9fLlr9VJ