diff options
| author | jackyzha0 <[email protected]> | 2021-03-07 08:13:10 -0800 |
|---|---|---|
| committer | jackyzha0 <[email protected]> | 2021-03-07 08:13:10 -0800 |
| commit | a9b72af75a9f9cc2be8cdec581133c0e9a301520 (patch) | |
| tree | f8d966ca52919047eb8fa74822af7c5d90d29710 /backend/security/hash.go | |
| parent | Merge pull request #71 from jackyzha0/http-refactor (diff) | |
| download | ctrl-v-a9b72af75a9f9cc2be8cdec581133c0e9a301520.tar.xz ctrl-v-a9b72af75a9f9cc2be8cdec581133c0e9a301520.zip | |
remove ip from hash calculation
Diffstat (limited to 'backend/security/hash.go')
| -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 |