Results 1 to 4 of 4

Thread: hashbytes

  1. #1
    Join Date
    Sep 2003
    Posts
    22

    Unanswered: hashbytes

    If I use the following command I get the correct md5 hash for my password column.
    Code:
    select hashbytes('MD5', 'mystring')
    When I try to save my hashbytes password in a column I get all kinds of garbage in the field. Example:
    Code:
    insert into users (user_pass) values (hashbytes('MD5', 'mystring'))
    Is there a certain type of field I have to use to store MD5 hashes?

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by RandyRiegel
    If I use the following command I get the correct md5 hash for my password column.
    Code:
    select hashbytes('MD5', 'mystring')
    When I try to save my hashbytes password in a column I get all kinds of garbage in the field. Example:
    Code:
    insert into users (user_pass) values (hashbytes('MD5', 'mystring'))
    Is there a certain type of field I have to use to store MD5 hashes?

    What are you using now?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Sep 2003
    Posts
    22
    nchar(32)

    I chose this because md5 strings are 32 character long.

  4. #4
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    use varbinary(32)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •