Move the flags into their own class.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Convert flags to use hex notation.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Add the explicit version flag.

The original C daniel implementation contained a flag (0x40) that indicated
that immediately following the flags field would be an explicit format
version number.  The length would then follow that format version number.

This was designed to allow different algorithms if necessary and was never
implemented, but it was documented in the source code.  Document it in the
source code here as well, even though it's not implemented yet.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Implement replication of existing passwords.

Sometimes one has an existing password that one wants to recreate later.
Implement a flag that indicates this mode.  Also, fix some of the existing
tests, since the flags value can be masked implicitly in some cases.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Add an additional test for existing password code.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Add utility function for converting hex strings.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Use utility functions for converting to and from hex.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>