fix: user id and link id int64 types

This commit is contained in:
sjdonado
2025-03-20 08:13:07 +01:00
parent 38f9cfd48e
commit 73ee4c4479
9 changed files with 33 additions and 45 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ require "digest"
require "base64"
module App::Services::SlugService
def self.shorten_url(url : String, user_id : String) : String
def self.shorten_url(url : String, user_id : Int64) : String
combined = "#{user_id}-#{url}"
crc32_hash = Digest::CRC32.digest(combined)
base62_encoded = Base64.urlsafe_encode(crc32_hash).strip.tr("-_=", "")