Add missing include.
Throw exception on error.
Change hash constants to more readable.
Use TR1 header for array.