Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 1 | OBSOLETE |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 2 | SYNOPSIS |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 3 | string sha1(string arg [, int iterations ]) |
| 4 | string sha1(bytes arg [, int iterations ]) |
| 5 | string sha1(int * arg [, int iterations ]) |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 6 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 7 | DESCRIPTION |
| 8 | Create and return a SHA1 message digest from <arg>. |
| 9 | <arg> may be a string, a byte sequence, or an array of numbers |
| 10 | (each considered to be a byte, ignoring all but the lowest 8 bits). |
| 11 | A string is converted to a UTF-8 byte sequence of which then the |
| 12 | digest will be created. |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 13 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 14 | If <iterations> is given as a number greater than 0, it is |
| 15 | the number of iterations used in the digest calculation. If omitted, |
| 16 | the driver executes just one iteration. |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 17 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 18 | The efun costs 5 ticks per iteration. |
| 19 | |
| 20 | EXAMPLES |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 21 | string s; |
| 22 | |
| 23 | s = sha1("Hello"); |
| 24 | s = sha1( ({ 'H', 'e', 'l', 'l', 'o' }) |
| 25 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 26 | HISTORY |
| 27 | Introduced in LDMud 3.3.523. |
| 28 | LDMud 3.3.712 added number arrays as argument, and the number |
| 29 | of iterations. |
| 30 | LDMud 3.3.717 added the iteration-based evaluation cost. |
| 31 | Since LDMud 3.3.719 obsoleted by hash(). |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 32 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 33 | SEE ALSO |
| 34 | crypt(E), md5(E), md5_crypt(E), hash(E), hmac(E) |