Last version: 0.0.1
Pure sha1 function use nothing else. Exported from golang runtime. And some examples of code.
To compile library and examples you will need to install
- c99 capable compiler (for now only gcc >=4.8 supported)
- openssl >=1.0 ( libcrypto )
- golang >=1.6
Instructions for Debian/Ubuntu like systems:
apt install build-essential
apt install libssl-dev
apt install golang-go
If your version of go not default:
GOROOT=/path/to/golang/installdir GO=go-x.y make lib
Not found library with only one function, so I tryed by myself.
Slightly faster file reading than sha1sum command.
But more memory consuming.
-
libsha1_go__version(void): Returns doted version string.
return:
* charsince: 0.0.1
-
libsha1_go__version_go(void): Returns version string of go rutime used.
return:
* charsince: 0.0.1
-
libsha1_go__SHA1_hexdigest(char* text): Return hexed-string with sha1 digest.
params:
- text (
char *): input string
return:
char *String with hexed digestsince: 0.0.1
- text (
-
libsha1_go__SHA1File_hexdigest(char* fullPath): Return hexed-string with sha1 digest of contents of the file.
params:
- fullPath (
char *): input full path to file as string
return:
char *String with hexed digest, if error occured - empty string returnssince: 0.0.1
- fullPath (
-
libsha1_go__SHA1_digest(char* text): Return non hexed(byte)-string with sha1 digest.
params:
- text (
char *): input string
return:
char *Bytes array, char string with digestsince: 0.0.1
- text (
-
libsha1_go__FreeResult(char* ptr): frees memory allocated for sha1 degest earlier.
return:
voidsince: 0.0.1