aboutsummaryrefslogtreecommitdiff
path: root/backend/security/hash.go
diff options
context:
space:
mode:
authorjackyzha0 <[email protected]>2021-03-07 08:13:10 -0800
committerjackyzha0 <[email protected]>2021-03-07 08:13:10 -0800
commita9b72af75a9f9cc2be8cdec581133c0e9a301520 (patch)
treef8d966ca52919047eb8fa74822af7c5d90d29710 /backend/security/hash.go
parentMerge pull request #71 from jackyzha0/http-refactor (diff)
downloadctrl-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.go4
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