inode_number=$(stat -c '%i' "$1")
#unique_id=$(echo "$inode_number" | sha1sum | awk '{print substr($1, 1, 4)}')
#unique_id=$((0x$(echo -n "$inode_number" | sha1sum | awk '{print $1}') % 4294967296))
unique_id=$((0x$(echo -n "$inode_number" | sha1sum | cut -c 1-8) % 10000))
echo $unique_id
Created
January 31, 2024 09:03
-
-
Save olekhy/c1d91b49f4f7a4b5401d4a2088a7b469 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment