From a9b72af75a9f9cc2be8cdec581133c0e9a301520 Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Sun, 7 Mar 2021 08:13:10 -0800 Subject: remove ip from hash calculation --- backend/security/hash.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backend/security/hash.go') 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 -- cgit v1.2.3