blob: a8ad455439d91afd6f01c2c807e3c378d1cea307 [file] [log] [blame]
Zesstra715ec202025-07-09 22:18:31 +02001OBSOLETE
Zesstrad59c3892019-11-28 20:53:39 +01002SYNOPSIS
Zesstra715ec202025-07-09 22:18:31 +02003 string sha1(string arg [, int iterations ])
4 string sha1(bytes arg [, int iterations ])
5 string sha1(int * arg [, int iterations ])
Zesstrad59c3892019-11-28 20:53:39 +01006
Zesstra715ec202025-07-09 22:18:31 +02007DESCRIPTION
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.
Zesstrad59c3892019-11-28 20:53:39 +010013
Zesstra715ec202025-07-09 22:18:31 +020014 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.
Zesstrad59c3892019-11-28 20:53:39 +010017
Zesstra715ec202025-07-09 22:18:31 +020018 The efun costs 5 ticks per iteration.
19
20EXAMPLES
Zesstrad59c3892019-11-28 20:53:39 +010021 string s;
22
23 s = sha1("Hello");
24 s = sha1( ({ 'H', 'e', 'l', 'l', 'o' })
25
Zesstra715ec202025-07-09 22:18:31 +020026HISTORY
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().
Zesstrad59c3892019-11-28 20:53:39 +010032
Zesstra715ec202025-07-09 22:18:31 +020033SEE ALSO
34 crypt(E), md5(E), md5_crypt(E), hash(E), hmac(E)