Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

In both Oracle and PostgreSQL I can get an MD5 hash value for any given string.

For example In Oracle 11gR2:

SQL> select rawtohex( DBMS_CRYPTO.Hash (utl_raw.cast_to_raw('xyz'),2) ) as hash_val from dual;

HASH_VAL
--------------------------------
D16FB36F0911F878998C136191AF705E

and in PostgreSQL 9.6:

ft_node=# select md5('xyz') as hash_val;
             hash_val             
----------------------------------
 d16fb36f0911f878998c136191af705e
(1 row)

As you see, apart from the case, the values match.

How can I get similar functionality in SQL Anywhere 17 ?

asked 27 Aug '17, 14:48

bluefrog's gravatar image

bluefrog
183141521
accept rate: 0%


It's called hash and it works thusly:

SELECT hash ( 'xyz', 'MD5' ) AS hash_val;

hash_val
d16fb36f0911f878998c136191af705e 
permanent link

answered 27 Aug '17, 16:00

Breck%20Carter's gravatar image

Breck Carter
32.5k5417261050
accept rate: 20%

3

...and it also offers much better hash algorithms than MD5, say SHA256...

(27 Aug '17, 16:13) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×7

question asked: 27 Aug '17, 14:48

question was seen: 1,905 times

last updated: 27 Aug '17, 16:13