diff options
| author | Jacky Zhao <[email protected]> | 2021-03-08 00:05:08 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-03-08 00:05:08 -0800 |
| commit | 9aa8dc921f03a08ca8987e4ca3f3f66a1f4b4981 (patch) | |
| tree | bffadcdef97795ce411231a74207f48165dcb96a /backend/security | |
| parent | css fix (diff) | |
| parent | remove ip from hash calculation (diff) | |
| download | ctrl-v-9aa8dc921f03a08ca8987e4ca3f3f66a1f4b4981.tar.xz ctrl-v-9aa8dc921f03a08ca8987e4ca3f3f66a1f4b4981.zip | |
Merge pull request #72 from jackyzha0/no-ip
Diffstat (limited to 'backend/security')
| -rw-r--r-- | backend/security/hash.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/security/hash.go b/backend/security/hash.go index b6ce167..cf7ef61 100644 --- a/backend/security/hash.go +++ b/backend/security/hash.go @@ -11,9 +11,9 @@ import ( const UrlLength = 7 // GenerateURI creates a unique identifier for a paste based on ip and timestamp -func GenerateURI(ip string) string { +func GenerateURI(content string) string { timeStamp := time.Now().String() - return hashString(ip + timeStamp)[:UrlLength] + return hashString(content + timeStamp)[:UrlLength] } // hashes using MD5 and then converts to base 62 |