Well, the code starts with i and id variables to be of type int and unsigned int respectively; it sets their initial values to 0. Variable l is set to the value returned by length method of name object variable. Then a loop starts through [l]while[/l], this loop keeps running as long as i is not equal to l.
Inside this loop:
* Another variable is declared and initialized in the same way mentioned above.
* The bits of a variable are shifted to the right by 8. This is the meaning of >> operator.
* static_cast<unsigned int>(name) is unclear for me!!
* i is increased. This is done through ++ operator.
* I think you understand this formula: id = (id << 1 | id >> 31) + a;.

Upon the loop terminal, the value of id is returned through the keyword return. However, this only works if this code is a part of a function!
Note: there's an extra bracket "}" which seems to be put by mistake or there is a starting bracket "{" before the start of the code but you did not place it here.

Hope this helps ...

Wesam