---
title: "What’s the difference between md5(), crc32() and sha1() crypto on PHP?"  
description: "What’s the difference between md5(), crc32() and sha1() crypto on PHP?"  
author: "Anonymous User"  
published: 2012-05-04  
updated: 2020-09-15  
canonical: https://www.mindstick.com/interview/1437/what-s-the-difference-between-md5-crc32-and-sha1-crypto-on-php  
category: "php"  
tags: ["php"]  
reading_time: 1 minute  

---

# What’s the difference between md5(), crc32() and sha1() crypto on PHP?

The major difference is the length of the hash generated. CRC32 is, evidently, 32 bits, while sha1() returns a 128 bit value, and md5() returns a 160 bit value. This is important when avoiding collisions.

## Answers

### Answer by Anonymous User

The major difference is the length of the hash generated. CRC32 is, evidently, 32 bits, while sha1() returns a 128 bit value, and md5() returns a 160 bit value. This is important when avoiding collisions.


---

Original Source: https://www.mindstick.com/interview/1437/what-s-the-difference-between-md5-crc32-and-sha1-crypto-on-php

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
