Digest Functions
The digest
module bundles various digest functions.
- Source
Methods
md2(str) → {string}nullable
Calculates the MD2 hash of string and returns that hash.
Returns null
if a non-string argument is given.
Name | Type | Description |
---|---|---|
str | string | The string to hash. |
md2("This is a test"); // Returns "dc378580fd0722e56b82666a6994c718"
md2(123); // Returns null
- Source
md2_file(path) → {string}nullable
Calculates the MD2 hash of a given file and returns that hash.
Returns null
if an error occurred.
Name | Type | Description |
---|---|---|
path | string | The path to the file. |
- Source
md4(str) → {string}nullable
Calculates the MD4 hash of string and returns that hash.
Returns null
if a non-string argument is given.
Name | Type | Description |
---|---|---|
str | string | The string to hash. |
md4("This is a test"); // Returns "3b487cf6856af7e330bc4b1b7d977ef8"
md4(123); // Returns null
- Source
md4_file(path) → {string}nullable
Calculates the MD4 hash of a given file and returns that hash.
Returns null
if an error occurred.
Name | Type | Description |
---|---|---|
path | string | The path to the file. |
- Source
md5(str) → {string}nullable
Calculates the MD5 hash of string and returns that hash.
Returns null
if a non-string argument is given.
Name | Type | Description |
---|---|---|
str | string | The string to hash. |
md5("This is a test"); // Returns "ce114e4501d2f4e2dcea3e17b546f339"
md5(123); // Returns null
- Source
md5_file(path) → {string}nullable
Calculates the MD5 hash of a given file and returns that hash.
Returns null
if an error occurred.
Name | Type | Description |
---|---|---|
path | string | The path to the file. |
- Source
sha1(str) → {string}nullable
Calculates the SHA1 hash of string and returns that hash.
Returns null
if a non-string argument is given.
Name | Type | Description |
---|---|---|
str | string | The string to hash. |
sha1("This is a test"); // Returns "a54d88e06612d820bc3be72877c74f257b561b19"
sha1(123); // Returns null
- Source
sha1_file(path) → {string}nullable
Calculates the SHA1 hash of a given file and returns that hash.
Returns null
if an error occurred.
Name | Type | Description |
---|---|---|
path | string | The path to the file. |
- Source
sha256(str) → {string}nullable
Calculates the SHA256 hash of string and returns that hash.
Returns null
if a non-string argument is given.
Name | Type | Description |
---|---|---|
str | string | The string to hash. |
sha256("This is a test"); // Returns "c7be1ed902fb8dd4d48997c6452f5d7e509fbcdbe2808b16bcf4edce4c07d14e"
sha256(123); // Returns null
- Source
sha256_file(path) → {string}nullable
Calculates the SHA256 hash of a given file and returns that hash.
Returns null
if an error occurred.
Name | Type | Description |
---|---|---|
path | string | The path to the file. |
- Source
sha384(str) → {string}nullable
Calculates the SHA384 hash of string and returns that hash.
Returns null
if a non-string argument is given.
Name | Type | Description |
---|---|---|
str | string | The string to hash. |
sha384("This is a test"); // Returns "a27c7667e58200d4c0688ea136968404a0da366b1a9fc19bb38a0c7a609a1eef2bcc82837f4f4d92031a66051494b38c"
sha384(123); // Returns null
- Source
sha384(str) → {string}nullable
Calculates the SHA384 hash of string and returns that hash.
Returns null
if a non-string argument is given.
Name | Type | Description |
---|---|---|
str | string | The string to hash. |
sha512("This is a test"); // Returns "a028d4f74b602ba45eb0a93c9a4677240dcf281a1a9322f183bd32f0bed82ec72de9c3957b2f4c9a1ccf7ed14f85d73498df38017e703d47ebb9f0b3bf116f69"
sha512(123); // Returns null
- Source
sha384_file(path) → {string}nullable
Calculates the SHA384 hash of a given file and returns that hash.
Returns null
if an error occurred.
Name | Type | Description |
---|---|---|
path | string | The path to the file. |
- Source
sha512_file(path) → {string}nullable
Calculates the SHA512 hash of a given file and returns that hash.
Returns null
if an error occurred.
Name | Type | Description |
---|---|---|
path | string | The path to the file. |
- Source