pike.git
/
src
/
post_modules
/
Nettle
/
hash.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/post_modules/Nettle/hash.cmod:1:
/* -*- c -*- || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: hash.cmod,v 1.
33
2010/06/
18
15
:
51
:
14
mast Exp $
+
|| $Id: hash.cmod,v 1.
34
2010/06/
21
12
:
23
:
15
mast Exp $
*/ #include "global.h" #include "interpret.h" #include "svalue.h" #include "threads.h" /* For this_object() */ #include "object.h" #include "module_support.h"
pike.git/src/post_modules/Nettle/hash.cmod:99:
if (!THIS->meta) Pike_error("HashInfo not properly initialized.\n"); push_int(THIS->meta->block_size); } /*! @decl string hash(string data) *! *! Works as a (faster) shortcut for
-
*!
@expr{obj
->update(data)->digest()@}.
+
*!
@expr{HashState()
->update(data)->digest()@}
, where HashState is
+
*! the hash state class corresponding to this HashInfo
.
*! *! @seealso *! @[HashState()->update()] and @[HashState()->digest()]. */ PIKEFUN string hash(string in) optflags OPT_TRY_OPTIMIZE; { void *ctx; struct pike_string *out; unsigned digest_length;
pike.git/src/post_modules/Nettle/hash.cmod:136:
meta->digest(ctx, digest_length, (uint8_t *)out->str); /* THREADS_DISALLOW(); */ pop_n_elems(args); push_string(end_shared_string(out)); } /*! @decl string hash(Stdio.File file, void|int bytes) *! *! Works as a (faster) shortcut for
-
*!
@expr{obj
->update(Stdio.read_file(file))->digest()@}.
+
*!
@expr{HashState()
->update(Stdio.read_file(file))->digest()@}
,
+
*! where HashState is the hash state class corresponding to this
+
*! HashInfo
.
*! *! @param bytes *! The number of bytes of the file object @[file] that should be *! hashed. Negative numbers are ignored and the whole file is *! hashed. *! *! @seealso *! @[Stdio.File], @[HashState()->update()] and *! @[HashState()->digest()]. */