mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 12:51:24 +08:00
DEV: Add Upload
to IntermediateDB (#29780)
This commit is contained in:
15
migrations/lib/common/id.rb
Normal file
15
migrations/lib/common/id.rb
Normal file
@ -0,0 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "digest/xxhash"
|
||||
|
||||
module Migrations
|
||||
module ID
|
||||
def self.hash(value)
|
||||
Digest::XXH3_128bits.base64digest(value)
|
||||
end
|
||||
|
||||
def self.build(part1, part2, *others)
|
||||
[part1, part2, *others].join("-")
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user