본문 바로가기
그냥 코딩!

C#와 PHP 에서 동일한 MD5 파일 체크섬 만들기

by Laeng 2017. 11. 1.

CRC32 도 한번 알아봐야겠다...


C#

function String MD5(String FILE)
{
    Byte[] asciiBytes = File.ReadAllBytes(FILE);
    Byte[] hashedBytes = MD5.Create().ComputeHash(asciiBytes);
    
    return BitConverter.ToString(hashedBytes).Replace("-", "").ToLower();
}


PHP

<?php
    $file = "/DO_NOT_DELETE";
    
    echo md5_file($file);
?>


반응형