Apply md5 hash to a field in csv file

I have a .csv file and I want to md5 hash the second column for each row in the file.
File is something like

data1,foobar1,123,345
data2,foobar2,456,9393
data3,foobar3,1002,10109

Output would be like

data1,6c81243028f8e455fa617dd5f0232ce1,123,345
data2,cbac77acf401ef89c3297bd9fc41ec0b,456,9393
data3,f8b8d6a7367c1e4e0d60c5ac26ba8b04,1002,10109

Any guidance would be appreciated.

What operating system are you using?

What shell are you using?

What output do you get from the command?:

type md5

Thanks for the reply. I'm using ksh
The output from

type md5

is

ksh: whence: md5: not found

With

type md5sum

I get

md5sum is a tracked alias for /usr/bin/md5sum
perl -MDigest::MD5=md5_hex -naF, -e 'BEGIN{$"=","} $F[1]=md5_hex($F[1]); print "@F"' jjwags.file 
data1,6c81243028f8e455fa617dd5f0232ce1,123,345
data2,cbac77acf401ef89c3297bd9fc41ec0b,456,9393
data3,f8b8d6a7367c1e4e0d60c5ac26ba8b04,1002,10109
2 Likes