473,396 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

sha1 column type

Hello,

I have read several online tutorials advocating storing a sha1() hashed
password in a column of type BLOB. As far as I can tell, sha1() always
returns a string of 40 characters, regardless of the size of the
original input. Is there any reason I can't store this as type CHAR? I
am running MySQL 4.1.x. Thanks in advance.
Jun 26 '06 #1
2 2493
Rik
Marcus wrote:
Hello,

I have read several online tutorials advocating storing a sha1()
hashed password in a column of type BLOB. As far as I can tell,
sha1() always returns a string of 40 characters, regardless of the
size of the original input. Is there any reason I can't store this
as type CHAR? I am running MySQL 4.1.x. Thanks in advance.


NATIONAL] CHAR(M) [BINARY | ASCII | UNICODE]
A fixed-length string that is always right-padded with spaces to the
specified length when stored. M represents the column length. The range of M
is 0 to 255 characters.

Should be possible without any problems...

Grtz,
--
Rik Wasmus
Jun 26 '06 #2
On Mon, 26 Jun 2006 13:24:01 -0500, Marcus <Ju********@aol.com> wrote:
I have read several online tutorials advocating storing a sha1() hashed
password in a column of type BLOB. As far as I can tell, sha1() always
returns a string of 40 characters, regardless of the size of the
original input. Is there any reason I can't store this as type CHAR? I
am running MySQL 4.1.x. Thanks in advance.


SHA1 produces a 20-byte hash, for which you could use BLOB, which can also be
represented as a 40-byte hexadecimal string, for which you can use a character
type.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jun 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Paul Rubin | last post by:
FYI. From <http://www.schneier.com/blog/archives/2005/02/sha1_broken.html>: The research team of Xiaoyun Wang, Yiqun Lisa Yin, and Hongbo Yu (mostly from Shandong University in China) have been...
6
by: Chang | last post by:
How to get SHA1 or MD5 of a big file (+5MB - 20GB) as I can't read 20GB into memory. -- Chang.
5
by: Michael H | last post by:
Hi all, I guess I don't fully understand how a SHA1 hash value is calculated in C# / .NET for a large file... I'm trying to calculate SHA1 values for large files that are much larger than my...
0
by: Dil via .NET 247 | last post by:
Fresher to .NET Aiming to produce a resulting hash of length 24 CHARACTERS, using MD5 or SHA1 Algorithms. According to the Class Libraries, the hash size for the SHA1 algorithm is 160 bits, and...
0
by: VAISH | last post by:
Hi I am using C# (.NET) to do the following I am trying to canonicalize the xml and signing the xml using sha1. Please read the scenario below I have form with few fields, when I click save...
8
by: sathyashrayan | last post by:
Dear group, For a log-in page I have created a mysql db and user registers with a user name and password. The password field is encrypted with $passwd = sha1($_REQUEST); I insert the...
2
by: amygdala | last post by:
Hi, Does anybody now of a custom crypt function that implements sha1? The thing I like about crypt is that I don't have to worry about (re)generating salt when querying the database. Or are...
7
by: php.developer2007 | last post by:
I want to know to decode sha1 encoded url into normal url. Example www.example.com/<sha1 code>/index1.htm I want this to www.example.com/index1.htm
5
by: LMZ | last post by:
How can convert string from sha1.hexdigest() to string that is the same, like from sha1.digest() thanks for your help! Alexandr.
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.