71b6403f90f9f221004a07cbd4e5aecedd9f6438 galt Mon Apr 24 12:41:27 2017 -0700 Refs #17538. Adds ability for user to paste a custom BED region into the multi-region dialog box instead of having to provide a URL to an on-line server. It still supports the URL through UDC however, which is more efficient for large custom region lists and also provides backwards compatibility. Uses sha1 instead of md5 for faster speed now. diff --git src/inc/sha1.h src/inc/sha1.h index 15d7fb5..3310b31 100644 --- src/inc/sha1.h +++ src/inc/sha1.h @@ -1,40 +1,40 @@ /* public api for steve reid's public domain SHA-1 implementation */ /* this file is in the public domain */ #ifndef SHA1_H #define SHA1_H typedef struct { - uint32_t state[5]; - uint32_t count[2]; - uint8_t buffer[64]; + bits32 state[5]; + bits32 count[2]; + bits8 buffer[64]; } SHA1_CTX; #define SHA1_DIGEST_SIZE 20 void SHA1_Init(SHA1_CTX* context); -void SHA1_Update(SHA1_CTX* context, const uint8_t* data, const size_t len); -void SHA1_Final(SHA1_CTX* context, uint8_t digest[SHA1_DIGEST_SIZE]); +void SHA1_Update(SHA1_CTX* context, const bits8* data, const size_t len); +void SHA1_Final(SHA1_CTX* context, bits8 digest[SHA1_DIGEST_SIZE]); /* ============== Added by UCSC Genome Browser ============= */ char *sha1ToHex(unsigned char hash[20]); /* Convert binary representation of sha1 to hex string. Do a freeMem on result when done. */ void sha1ForFile(char *fileName, unsigned char hash[20]); /* Make sha1 hash from file */ char *sha1HexForFile(char *fileName); /* Return Sha1 as Hex string */ void sha1ForBuf(char *buffer, size_t bufSize, unsigned char hash[20]); /* Return sha1 hash of buffer. */ char *sha1HexForBuf(char *buf, size_t bufSize); /* Return Sha1 as Hex string */ char *sha1HexForString(char *string); /* Return sha sum of zero-terminated string. */ #endif