12月 11, 2019 NodeJS
### What is MD5?

The MD5 message-digest algorithm is a widely used hash function producing a 128-bit hash value.

From [Wikipedia MD5](https://en.wikipedia.org/wiki/MD5)

You can simply think that there is a function called md5(), by providing a string to that function and it will return a MD5 string to you. A MD5 string is fixed length. That means whatever how much data you input to the md5() function. The string length of output will always the same.

### How to generate MD5 string?

Different programming language has their own methods / library to generate a MD5 string. 

In NodeJS, a built in module called `crypto` can help you do the staff :

```js
// import module
const crypto = require('crypto');

// input data
var data = 'hello world';

// and md5 string of 'hello world'
var md5String = crypto.createHash('md5').update(data).digest('hex');
```

There are many other digest methods that supported by `crypto` module. You can navigate to Tools page to try out the online MD5 converter.
過去文章
2025 (9)
4 (5)
3 (1)
2 (3)
2024 (25)
11 (3)
10 (3)
9 (1)
3 (18)
2022 (6)
10 (1)
6 (2)
5 (1)
3 (1)
1 (1)
2021 (21)
11 (7)
7 (1)
6 (2)
5 (2)
4 (6)
3 (2)
2 (1)
2020 (92)
12 (1)
11 (2)
10 (4)
9 (10)
8 (5)
7 (1)
6 (3)
5 (1)
4 (4)
3 (25)
2 (7)
1 (29)
2019 (57)
12 (25)
11 (7)
9 (25)