aboutsummaryrefslogtreecommitdiff
path: root/backend/security
diff options
context:
space:
mode:
authorJacky Zhao <[email protected]>2021-03-08 00:05:08 -0800
committerGitHub <[email protected]>2021-03-08 00:05:08 -0800
commit9aa8dc921f03a08ca8987e4ca3f3f66a1f4b4981 (patch)
treebffadcdef97795ce411231a74207f48165dcb96a /backend/security
parentcss fix (diff)
parentremove ip from hash calculation (diff)
downloadctrl-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.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