473,811 Members | 3,152 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hash/digest function

Hello,

I'm looking for a built-in hashing/digest function in DB2, e.g. MD5 or
SHA1. It seems there is no such thing. Or have I overlooked something?

If I were to add md5sum to db2 as a c- or java-based function: Is there a
repository of popular ready-to-compile DB2-functions somewhere?

--
Regards,
Troels Arvin <tr****@arvin.d k>
http://troels.arvin.dk/
Feb 19 '07 #1
3 10279
On Feb 20, 12:50 am, Troels Arvin <tro...@arvin.d kwrote:
Hello,

I'm looking for a built-in hashing/digest function in DB2, e.g. MD5 or
SHA1. It seems there is no such thing. Or have I overlooked something?

If I were to add md5sum to db2 as a c- or java-based function: Is there a
repository of popular ready-to-compile DB2-functions somewhere?
Found this:

http://www-128.ibm.com/developerwork...-0407tessarek/

haven't tried it
/Lennart

--
Regards,
Troels Arvin <tro...@arvin.d k>http://troels.arvin.dk/

Feb 20 '07 #2
On 19 Feb, 22:50, Troels Arvin <tro...@arvin.d kwrote:
Hello,

I'm looking for a built-in hashing/digest function in DB2, e.g. MD5 or
SHA1. It seems there is no such thing. Or have I overlooked something?
Hi Troels,

I looked into this a while ago as I ported a small PostgreSQL database
to DB2. All the user passwords were MD5-hashed, and in the end I
rolled my own Java function as I couldn't find any built-in way of
doing the same.

Cheers

Michael

Feb 22 '07 #3
On Feb 19, 11:50 pm, Troels Arvin <tro...@arvin.d kwrote:
I'm looking for a built-in hashing/digest function in DB2, e.g.MD5or
SHA1.
Serge Rielau proposes a HASH function in this post:

http://groups.google.com/group/comp....501fab70796eae

You could download the source for a MD5 algorithm and use that instead
of the HASH function, following the above example. There's an open-
source implementation in C of the MD5 algorithm in the GNU coreutils
package:

http://www.gnu.org/software/coreutils/

--
Serman D.

Feb 22 '07 #4

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

Similar topics

1
1858
by: Karel Kubat | last post by:
Hi all, I have a problem with a snippet of code. I'm trying to pass a hash as an argument to a function. Below is some test code: --- snip snip use strict; my %map = { 1 => 'one', 2 => 'two',
10
18625
by: Mamuninfo | last post by:
Hello, Have any function in the DB2 database that can generate unique id for each string like oracle, mysql,sybase,sqlserver database. In mysql:- select md5(concat_ws("Row name")) from tablename; Here this function generate unique id for each row of the table. Regards..
21
3915
by: Hallvard B Furuseth | last post by:
Is the code below valid? Generally a value must be accessed through the same type it was stored as, but there is an exception for data stored through a character type. I'm not sure if that applies in this case though: #include <limits.h> unsigned foo(void) { static const union { unsigned char str;
6
3514
by: Wijaya Edward | last post by:
Hi, How can I pass Array, Hash, and a plain variable in to a function at the same time. I come from Perl. Where as you probably know it is done like this: sub myfunc {
5
6140
by: for.fun | last post by:
Hi everybody, I need to calculate the hash code of a text file (in order to uniquely identify a file) My program has to run under Windows and under Unix (Solaris) That's why I am looking for a Standard C++ function which would calculate the hash value. Does anyone knows if such a function exist ?
3
3382
by: giloosh | last post by:
can i pass a hash as a function parameter. ive seen it been used before but i can't figure out how to do it. i would like to call a function like this for example doSomething({variable1:"blabla",variable2:"blabla"}); how would function doSomething be written for this to work. I would also like the hash to be optional and the variables in the
2
5833
by: joe shoemaker | last post by:
I would like to convert url into md5 hash. My question is that md5 hash will create collision at 2^64. If you do long(value,16), where value is the md5 hash string, would value returned from long(value, 16) be unique as long as md5 hashed string is unique? when you move md5 hashed string to long, where will the collision occur, at anything hash = md5.new() hash.update("some_url_") value = hash.digest() value_in_int = long(value, 16)...
1
5851
by: qiss | last post by:
Essentially my problem is that I have a java application that uses SHA-1 encryption and I have a .Net 2.0 WebService that needs to encrypt the same way for user authentication (passwords are encrypted in the database) Take care to notice the wonderful wack in the java code to add 256 to the byte value. Essentially the problem is that when I create the ASCII byte array the values are the same: Password = test; Java:
1
1066
by: Chris Lindsay | last post by:
I've got the following code: var hash = location.hash; setInterval(function() { if (location.hash != hash) { hash = location.hash; callFn = location.hash.substring(1);
0
9730
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10392
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10403
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5555
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4341
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3868
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.