dbTalk Databases Forums  

Checksum of a string

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss Checksum of a string in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
brunoalsantos
 
Posts: n/a

Default Checksum of a string - 05-25-2011 , 10:21 AM






Hello all,

DB2 V9.5 LUW Fixpack 5.

Is there in DB2 a function that returns the checksum of a string, like
the sum of UNIX?

In Unix/Linux:

[db2inst1@JULIANA-PIRES ~]$ echo "Super string bla bla bla" | sum
49605 1

Best regards.

Bruno.

Reply With Quote
  #2  
Old   
Lennart Jonsson
 
Posts: n/a

Default Re: Checksum of a string - 05-25-2011 , 02:02 PM






On 2011-05-25 17:21, brunoalsantos wrote:
Quote:
Hello all,

DB2 V9.5 LUW Fixpack 5.

Is there in DB2 a function that returns the checksum of a string, like
the sum of UNIX?

Not as far as I know but if you know the algorithm it's possible to
implement your own function, possibly even in sql. I once had the
misfortune having to implement a base64 decoder in sql, not a pretty
sight ;-)


/Lennart

[...]

Reply With Quote
  #3  
Old   
Helmut Tessarek
 
Posts: n/a

Default Re: Checksum of a string - 05-25-2011 , 03:18 PM



Hi Bruno,

Quote:
Is there in DB2 a function that returns the checksum of a string, like
the sum of UNIX?

In Unix/Linux:

[db2inst1@JULIANA-PIRES ~]$ echo "Super string bla bla bla" | sum
49605 1
No, there are no checksum functions shipped with DB2, but I wrote UDFs for
md5, seeded md5, seeded sha1 and seeded crypt.

http://j.mp/kb9BJL

You will need APR and APR-util to compile the UDFs.

--
Helmut K. C. Tessarek
DB2 Performance and Development
IBM Toronto Lab

Reply With Quote
  #4  
Old   
brunoalsantos
 
Posts: n/a

Default Re: Checksum of a string - 05-25-2011 , 04:01 PM



On May 25, 5:18*pm, Helmut Tessarek <tessa... (AT) evermeet (DOT) cx> wrote:
Quote:
Hi Bruno,

Is there in DB2 a function that returns the checksum of a string, like
the sum of UNIX?

In Unix/Linux:

[db2inst1@JULIANA-PIRES ~]$ echo "Super string bla bla bla" | sum
49605 * * 1

No, there are no checksum functions shipped with DB2, but I wrote UDFs for
md5, seeded md5, seeded sha1 and seeded crypt.

http://j.mp/kb9BJL

You will need APR and APR-util to compile the UDFs.

--
Helmut K. C. Tessarek
DB2 Performance and Development
IBM Toronto Lab
Helmut and Lennart.

Thanks for reply.

Today, we use a shell script + sql commands to get this information
( checksum ).
I will check with my team what solution weŽll use.

Best.

Bruno

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.