I am implementing bcrypt for java as found here. Before the actual hash takes place, line 455 of this implementation takes the raw String password, and transforms it into a byte array like so:
passwordb = (password + (minor >= 'a' ? "\000" : "")).getBytes("UTF-8");
minor >= 'a', as is always true for this implementation (I assume this is a version identifier?), then
\000 is concatenated onto the end of the password before its transformation into bytes.
What purpose does adding
\000 to the password provide?