123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- # Copyright 1994, Regents of the University of California.
- # Copyright 1996-2022 PostgreSQL Global Development Group.
- # Copyright Materialize, Inc. and contributors. All rights reserved.
- #
- # Use of this software is governed by the Business Source License
- # included in the LICENSE file at the root of this repository.
- #
- # As of the Change Date specified in that file, in accordance with
- # the Business Source License, use of this software will be governed
- # by the Apache License, Version 2.0.
- #
- # This file is derived from the regression test suite in PostgreSQL.
- # The original file was retrieved on February 3, 2022 from:
- #
- # https://github.com/postgres/postgres/blob/d33a81203e95d31e62157c4ae0e00e2198841208/src/test/regress/expected/strings.out
- #
- # The original source code is subject to the terms of the PostgreSQL
- # license, a copy of which can be found in the LICENSE file at the
- # root of this repository.
- # At the time of writing this file contains only PostgreSQL's
- # hash-function-related string tests, which constitute only a small fraction of
- # the available string tests upstream.
- mode cockroach
- # MD5 test suite - from IETF RFC 1321
- # (see: ftp://ftp.rfc-editor.org/in-notes/rfc1321.txt)
- statement ok
- CREATE TABLE md5_test (t text)
- statement ok
- INSERT INTO md5_test VALUES
- (''),
- ('a'),
- ('abc'),
- ('message digest'),
- ('abcdefghijklmnopqrstuvwxyz'),
- ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'),
- ('12345678901234567890123456789012345678901234567890123456789012345678901234567890')
- query T rowsort
- SELECT md5(t) FROM md5_test ORDER BY t
- ----
- d41d8cd98f00b204e9800998ecf8427e
- 0cc175b9c0f1b6a831c399e269772661
- 900150983cd24fb0d6963f7d28e17f72
- f96b697d7cb7938d525a2f31aaf161d0
- c3fcd3d76192e4007dfb496cca67e13b
- d174ab98d277d9f5a5611c2c9f419d9f
- 57edf4a22be3c955ac49da2e2107b67a
- query I
- SELECT count(*) FROM md5_test WHERE md5(t) <> md5(t::bytea)
- ----
- 0
- # SHA-2
- query T
- SELECT sha224('')::text
- ----
- \xd14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f
- query T
- SELECT sha224('The quick brown fox jumps over the lazy dog.')::text
- ----
- \x619cba8e8e05826e9b8c519c0a5c68f4fb653e8a3d8aa04bb2c8cd4c
- query T
- SELECT sha256('')::text
- ----
- \xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
- query T
- SELECT sha256('The quick brown fox jumps over the lazy dog.')::text
- ----
- \xef537f25c895bfa782526529a9b63d97aa631564d5d789c2b765448c8635fb6c
- query T
- SELECT sha384('')::text
- ----
- \x38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b
- query T
- SELECT sha384('The quick brown fox jumps over the lazy dog.')::text
- ----
- \xed892481d8272ca6df370bf706e4d7bc1b5739fa2177aae6c50e946678718fc67a7af2819a021c2fc34e91bdb63409d7
- query T
- SELECT sha512('')::text
- ----
- \xcf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e
- query T
- SELECT sha512('The quick brown fox jumps over the lazy dog.')::text
- ----
- \x91ea1245f20d46ae9a037a989f54f1f790f0a47607eeb8a14d12890cea77a1bbc6c7ed9cf205e67b7f2b8fd4c7dfd3a7a8617e45f3c463d481c7e586c39ac1ed
|