Database adding letters to my output why?
public User GetUserByUsername(string username) {
var usr = _context.Users.SingleOrDefault(x => x.Username == username);
Debug.WriteLine(usr.PasswordHash);
return usr;
}
The Debug write has this output:
$2a$12$3JIbqxqlKHEDJrXrUOUthursGxwFsidNVFkEvuDBqns1ThlNJlU9u
when i debug the object it shows me this:
"$2a$12$3JIbqxqlKHEDJrXrUOUthursGxwFsidNVFkEvuDBqns1ThlNJlU9u\r\n"
i am using EF core and sql server for that...
why is that what is happening here?
5 Replies
Debug.WriteLine is adding a carriage return to the output.
Use Debug.Write instead.
its about the database output the debug writeline shows the exact value stored in the databasse..
my misunderstanding
and you've confirmed that the carriage return and line feed are not in the database?
where are you saving the password hash?
yeah, that's what I'm thinking