Solve a challenge to iterate truncated md5 hash in bash

Problem:
With this string: OTE2MDM5NjJmZDdkYTQ0OA==
MD5 hash it and remove the last 16 characters of the hash. Iterate this process 50 times and submit the final truncated hash below.

Solution:

#!/bin/bash

str="OTE2MDM5NjJmZDdkYTQ0OA=="

for i in {1..50}
do
  str=$(echo $str | md5sum | cut -c1-16)
done

echo $str
Output:
076f9461e86839f6