I think what you might want (for sql server) is this:
update people_t set passwordhash = HASHBYTES('SHA1', username)
Your pseudo code seems to set a single hash (which would be based on one username) and then is updating all people with that single username.
Not sure what the SHA1 type is in your code above - don't recognize that.