Standartisise the API hashing

Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
This commit is contained in:
Ari Archer 2022-09-23 02:18:03 +03:00
parent 52bdd26d93
commit 8553b253a5
2 changed files with 3 additions and 3 deletions

View file

@ -30,8 +30,8 @@ slow, so there's hashes for them, they are sha256 hashes of
those JSON files in the api those JSON files in the api
So what you do, replace all `.` in the API name with \_, So what you do, replace all `.` in the API name with \_,
then make the request to `/api_hash/....txt` and you will then make the request to `/api_hash/..._hash.txt` and you will
get the hash, for example: <https://www.ari-web.xyz/api_hash/apis_json.txt> get the hash, for example: <https://www.ari-web.xyz/api_hash/apis_json_hash.txt>
# Usage API # Usage API

View file

@ -30,7 +30,7 @@ main() {
for api in api/*; do for api in api/*; do
api_base="${api##*/}" api_base="${api##*/}"
sha256sum "$api" | awk '{ print $1 }' >"api_hash/${api_base//./_}.txt" sha256sum "$api" | awk '{ print $1 }' | tr -d '\n' >"api_hash/${api_base//./_}_hash.txt"
done done
echo 'done' echo 'done'