From e5b9766162d605f4706fe589dbdfaab0feb6bc38 Mon Sep 17 00:00:00 2001 From: lvsi <15239928381@163.com> Date: Thu, 19 Jan 2023 14:16:16 +0800 Subject: [PATCH] chore: add generate_signed_api.sh --- bin/generate_signed_api.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 bin/generate_signed_api.sh diff --git a/bin/generate_signed_api.sh b/bin/generate_signed_api.sh new file mode 100644 index 0000000..b818c3d --- /dev/null +++ b/bin/generate_signed_api.sh @@ -0,0 +1,17 @@ +timeStamp=`date +%s` +echo "timeStamp=$timeStamp" + +(( length=timeStamp%16+10 )) +echo "length=$length" + +secret="ngxway" +sign="${timeStamp}_${secret}_${timeStamp}" +echo "sign=$sign" + +signMd5=`md5 -s ${sign} | awk '{ print $4 }'` +echo "signMd5=$signMd5" + +result=${signMd5: 0: $length} +echo "result = " $result + +echo "url = 127.0.0.1:8090?sign=${result}×tamp=${timeStamp}"