You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JavaScript MD5 implementation. Compatible with server-side environments like node.js, module loaders like RequireJS and all web browsers.
8
8
9
9
## Usage
10
10
11
11
### Client-side
12
-
Include the (minified) JavaScript [MD5](http://en.wikipedia.org/wiki/MD5) script in your HTML markup:
12
+
Include the (minified) JavaScript [MD5](https://en.wikipedia.org/wiki/MD5) script in your HTML markup:
13
13
14
14
```html
15
15
<scriptsrc="js/md5.min.js"></script>
16
16
```
17
17
18
-
In your application code, calculate the ([hex](http://en.wikipedia.org/wiki/Hexadecimal)-encoded) [MD5](http://en.wikipedia.org/wiki/MD5) hash of a string by calling the **md5** method with the string as argument:
18
+
In your application code, calculate the ([hex](https://en.wikipedia.org/wiki/Hexadecimal)-encoded) [MD5](https://en.wikipedia.org/wiki/MD5) hash of a string by calling the **md5** method with the string as argument:
19
19
20
20
```js
21
21
var hash =md5("value"); // "2063c1608d6e0baf80249c42e2be5804"
@@ -25,7 +25,7 @@ var hash = md5("value"); // "2063c1608d6e0baf80249c42e2be5804"
25
25
26
26
The following is an example how to use the JavaScript MD5 module on the server-side with [node.js](http://nodejs.org/).
27
27
28
-
Create a new directory and add the **md5.js** file. Or alternatively, install the **blueimp-md5** package with [npm](http://npmjs.org/):
28
+
Create a new directory and add the **md5.js** file. Or alternatively, install the **blueimp-md5** package with [npm](https://www.npmjs.org/):
29
29
30
30
```sh
31
31
npm install blueimp-md5
@@ -59,32 +59,32 @@ The JavaScript MD5 script has zero dependencies.
59
59
60
60
## API
61
61
62
-
Calculate the ([hex](http://en.wikipedia.org/wiki/Hexadecimal)-encoded) [MD5](http://en.wikipedia.org/wiki/MD5) hash of a given string value:
62
+
Calculate the ([hex](https://en.wikipedia.org/wiki/Hexadecimal)-encoded) [MD5](https://en.wikipedia.org/wiki/MD5) hash of a given string value:
63
63
64
64
```js
65
65
var hash =md5("value"); // "2063c1608d6e0baf80249c42e2be5804"
66
66
```
67
67
68
-
Calculate the ([hex](http://en.wikipedia.org/wiki/Hexadecimal)-encoded) [HMAC](http://en.wikipedia.org/wiki/HMAC)-MD5 hash of a given string value and key:
68
+
Calculate the ([hex](https://en.wikipedia.org/wiki/Hexadecimal)-encoded) [HMAC](https://en.wikipedia.org/wiki/HMAC)-MD5 hash of a given string value and key:
69
69
70
70
```js
71
71
var hash =md5("value", "key"); // "01433efd5f16327ea4b31144572c67f6"
72
72
```
73
73
74
-
Calculate the raw [MD5](http://en.wikipedia.org/wiki/MD5) hash of a given string value:
74
+
Calculate the raw [MD5](https://en.wikipedia.org/wiki/MD5) hash of a given string value:
75
75
76
76
```js
77
77
var hash =md5("value", null, true);
78
78
```
79
79
80
-
Calculate the raw [HMAC](http://en.wikipedia.org/wiki/HMAC)-MD5 hash of a given string value and key:
80
+
Calculate the raw [HMAC](https://en.wikipedia.org/wiki/HMAC)-MD5 hash of a given string value and key:
81
81
82
82
```js
83
83
var hash =md5("value", "key", true);
84
84
```
85
85
86
86
## Tests
87
-
The JavaScript MD5 project comes with [Unit Tests](http://en.wikipedia.org/wiki/Unit_testing).
87
+
The JavaScript MD5 project comes with [Unit Tests](https://en.wikipedia.org/wiki/Unit_testing).
Compatible with server-side environments like <ahref="http://nodejs.org/">node.js</a>, module loaders like <ahref="http://requirejs.org/">RequireJS</a> and all web browsers.</p>
0 commit comments