mirror of
https://github.com/tursodatabase/libsql.git
synced 2025-03-08 23:41:50 +00:00
A common complain with libSQL is how to run extensions. The main mechanism, with a .so, has a lot of issues around how those .so are distributed. The most common extensions are the ones in the sqlean package. We can improve this experience by bundling them in our sqlite build. Not all SQLean extensions are kosher: some of them, like fileio, use the vfs. Others, are deemed too complex. The extensions included here are a subset that we deem important enough, and low risk enough, to just be a part of the main bundle.
22 lines
454 B
C
22 lines
454 B
C
// Adapted from https://sqlite.org/src/file/ext/misc/sha1.c
|
|
// Public domain
|
|
|
|
#ifndef __SHA1_H__
|
|
#define __SHA1_H__
|
|
|
|
#include <stddef.h>
|
|
|
|
#define SHA1_BLOCK_SIZE 20
|
|
|
|
typedef struct SHA1Context {
|
|
unsigned int state[5];
|
|
unsigned int count[2];
|
|
unsigned char buffer[64];
|
|
} SHA1Context;
|
|
|
|
void* sha1_init();
|
|
void sha1_update(SHA1Context* ctx, const unsigned char data[], size_t len);
|
|
int sha1_final(SHA1Context* ctx, unsigned char hash[]);
|
|
|
|
#endif
|