---
title: "Discussion on \"djb2 Hash Function: String to Integer Algorithm Explained\" | Hashnode"
description: "Discussion on \"djb2 Hash Function: String to Integer Algorithm Explained\". Learn how the djb2 hash function converts strings to integers using ASCII values, and why the magic numbers 5381 and 33 work so well for hash maps."
url: "https://hashnode.com/posts/djb2-hash-function-explained/6a33aeb84092801b131c66bf"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [djb2 Hash Function: String to Integer Algorithm Explained](https://doogal.dev/djb2-hash-function-explained?utm_source=hashnode&utm_medium=feed)

Learn how the djb2 hash function converts strings to integers using ASCII values, and why the magic numbers 5381 and 33 work so well for hash maps.

Jun 18 · 5 min read · doogal.dev  
Updated Jul 19  
Read the article

-   [#algorithms](https://hashnode.com/tag/algorithms)
-   [#hashfunctions](https://hashnode.com/tag/hashfunctions)
-   [#datastructures](https://hashnode.com/tag/datastructures)
-   [#computerscience](https://hashnode.com/tag/computerscience)

## Written by

[Doogal Simpson](https://hashnode.com/@doogal)

@doogal

  
[View profile](https://hashnode.com/@doogal)

"hey doogal, what is .... ?"

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
