Skip to content

Commit

Permalink
chore: add generate_signed_api.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
WGrape committed Jan 19, 2023
1 parent d7b69c9 commit e5b9766
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions bin/generate_signed_api.sh
Original file line number Diff line number Diff line change
@@ -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}&timestamp=${timeStamp}"

0 comments on commit e5b9766

Please sign in to comment.