added kudos to stackoverflow for the convertToSHA method