File: njs_hash.h

package info (click to toggle)
libnginx-mod-js 0.8.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,808 kB
  • sloc: ansic: 114,096; perl: 8,447; javascript: 2,520; exp: 487; sh: 322; xml: 312; python: 181; makefile: 18
file content (32 lines) | stat: -rw-r--r-- 880 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

/*
 * Copyright (C) Dmitry Volyntsev
 * Copyright (C) NGINX, Inc.
 */


#ifndef _NJS_HASH_H_INCLUDED_
#define _NJS_HASH_H_INCLUDED_


typedef struct {
    uint64_t  bytes;
    uint32_t  a, b, c, d, e, f, g, h;
    u_char    buffer[64];
} njs_hash_t;


NJS_EXPORT void njs_md5_init(njs_hash_t *ctx);
NJS_EXPORT void njs_md5_update(njs_hash_t *ctx, const void *data, size_t size);
NJS_EXPORT void njs_md5_final(u_char result[32], njs_hash_t *ctx);

NJS_EXPORT void njs_sha1_init(njs_hash_t *ctx);
NJS_EXPORT void njs_sha1_update(njs_hash_t *ctx, const void *data, size_t size);
NJS_EXPORT void njs_sha1_final(u_char result[32], njs_hash_t *ctx);

NJS_EXPORT void njs_sha2_init(njs_hash_t *ctx);
NJS_EXPORT void njs_sha2_update(njs_hash_t *ctx, const void *data, size_t size);
NJS_EXPORT void njs_sha2_final(u_char result[32], njs_hash_t *ctx);


#endif /* _NJS_HASH_H_INCLUDED_ */