Spaces:
Sleeping
Sleeping
Download internal/utils/hashing.go from codebydante/BrodyFileStreamBot: direct link, hf CLI and curl.
- Browser
- Download file 525 Bytes
-
https://huggingface.co/spaces/codebydante/BrodyFileStreamBot/resolve/bd894b382ed6a42e3879e3846027d7e6d427f3f2/internal/utils/hashing.go
- Command line
-
hf download hf://spaces/codebydante/BrodyFileStreamBot@bd894b382ed6a42e3879e3846027d7e6d427f3f2/internal/utils/hashing.go
-
curl -L -o hashing.go https://huggingface.co/spaces/codebydante/BrodyFileStreamBot/resolve/bd894b382ed6a42e3879e3846027d7e6d427f3f2/internal/utils/hashing.go
525 Bytes
| package utils | |
| import ( | |
| "EverythingSuckz/fsb/config" | |
| "EverythingSuckz/fsb/internal/types" | |
| ) | |
| func PackFile(fileName string, fileSize int64, mimeType string, fileID int64) string { | |
| return (&types.HashableFileStruct{FileName: fileName, FileSize: fileSize, MimeType: mimeType, FileID: fileID}).Pack() | |
| } | |
| func GetShortHash(fullHash string) string { | |
| return fullHash[:config.ValueOf.HashLength] | |
| } | |
| func CheckHash(inputHash string, expectedHash string) bool { | |
| return inputHash == GetShortHash(expectedHash) | |
| } | |