in reply to Binary value of string

I would advise you to look at a standard hashing algorithm (like sha1,sha2 or md5)

If you still want to do it yourself:

$string = "This is a string to split and sum"; @chars = split(//,$string); $sum = 0; for(@chars) { #ord returns the numeric value of the char printf"char = %s:bin = %8b:dec = %d\n",$_,ord,ord; $sum+=ord; } print "sum = $sum\n"; #OUTPUT #char = T:bin = 1010100:dec = 84 #char = h:bin = 1101000:dec = 104 #char = i:bin = 1101001:dec = 105 #char = s:bin = 1110011:dec = 115 #char = :bin = 100000:dec = 32 #char = i:bin = 1101001:dec = 105 #char = s:bin = 1110011:dec = 115 #char = :bin = 100000:dec = 32 #char = a:bin = 1100001:dec = 97 #char = :bin = 100000:dec = 32 #char = s:bin = 1110011:dec = 115 #char = t:bin = 1110100:dec = 116 #char = r:bin = 1110010:dec = 114 #char = i:bin = 1101001:dec = 105 #char = n:bin = 1101110:dec = 110 #char = g:bin = 1100111:dec = 103 #char = :bin = 100000:dec = 32 #char = t:bin = 1110100:dec = 116 #char = o:bin = 1101111:dec = 111 #char = :bin = 100000:dec = 32 #char = s:bin = 1110011:dec = 115 #char = p:bin = 1110000:dec = 112 #char = l:bin = 1101100:dec = 108 #char = i:bin = 1101001:dec = 105 #char = t:bin = 1110100:dec = 116 #char = :bin = 100000:dec = 32 #char = a:bin = 1100001:dec = 97 #char = n:bin = 1101110:dec = 110 #char = d:bin = 1100100:dec = 100 #char = :bin = 100000:dec = 32 #char = s:bin = 1110011:dec = 115 #char = u:bin = 1110101:dec = 117 #char = m:bin = 1101101:dec = 109 #sum = 3043