40 Flutter仿京東商城項目簽名驗證原理、簽名驗證算法

加羣452892873 下載對應40課文件,運行方法,建好項目,直接替換lib目錄ui

pubspec.yamlspa

crypto: ^2.1.3

 

SignServices.dartcode

import 'dart:convert'; import 'package:crypto/crypto.dart'; class SignServices{ static getSign(){ Map addressListAttr={ "uid":'1', "age":10, "salt":'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' //私鑰
 }; List attrKeys=addressListAttr.keys.toList(); attrKeys.sort(); print(attrKeys); String str=''; for(var i=0;i<attrKeys.length;i++){ str+="${attrKeys[i]}${addressListAttr[attrKeys[i]]}"; } print(str); print(md5.convert(utf8.encode(str))); } }
相關文章
相關標籤/搜索