Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

hash() function hangs endlessly if using sha512 on strings >= 4GiB #12936

Closed
@ohyeaah

Description

@ohyeaah

Description

The following script hangs endlessly.

<?php$t =time();echohash("sha512",str_repeat("x",1024*1024*1024*4-1));echo"\ncalculating hash took".(time() -$t)."s\n";$t =time();echohash("sha512",str_repeat("x",1024*1024*1024*4));echo"\ncalculating hash took".(time() -$t)."s\n";?>

Resulted in this output:

f918f25f32fe81f274619743e661a4158f176384d74b46bce7c4305f160119ce727204db2910ff287535ca2e40c2a98f2d23b40c82afbcca750a532b9843e3bccalculating hash took 14s

But I expected this output instead:

f918f25f32fe81f274619743e661a4158f176384d74b46bce7c4305f160119ce727204db2910ff287535ca2e40c2a98f2d23b40c82afbcca750a532b9843e3bccalculating hash took 14s...hash goes here...calculating hash took 14s

PHP Version

PHP 8.2.10-2ubuntu1 (cli) (built: Sep 5 2023 14:37:47) (NTS)

Operating System

KUbuntu 23.10

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp