#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import hashlib
string = '123456SkinRun51'
md5=hashlib.md5()
md5.update(string.encode('utf-8'))
res=md5.hexdigest()
print('md5加密后结果:',res)
-------------------------------------------
echo md5(utf8_encode('123456SkinRun51')).PHP_EOL;
exit();
叙述:python3.6.6 ;php7
Python:
>>> import hashlib
>>> hashlib.md5("测试").hexdigest()
'db06c78d1e24cf708a14ce81c9b617ec'
PHP:
$ echo '' | php
db06c78d1e24cf708a14ce81c9b617ec
一样的哦 :)
是一样的,你自己核对下