Posted to tcl by evilotto at Tue Feb 28 01:45:39 GMT 2017view raw

  1. proc hashit {s} {
  2. set i 0
  3. foreach {c} [split $s ""] {
  4. set i [expr {(33 * $i ^ [scan $c %c]) & 0xffffffff}]
  5. }
  6. format %08x $i
  7. }
  8.  
  9.