i figured it out

This commit is contained in:
winter 2023-01-01 01:39:53 +09:00
parent 426da44bee
commit 77aeb6ba57
2 changed files with 1 additions and 3 deletions

View file

@ -55,13 +55,11 @@ module CrystalGauntlet::Hashes
end
def gen_pack(map_packs : Array(Tuple(Int32, Int32, Int32))) : String
puts map_packs
Digest::SHA1.hexdigest do |ctx|
map_packs.each.with_index() do |val, index|
level_id, stars, coins = val
level_id_str = level_id.to_s
ctx.update "#{level_id_str[0]}#{level_id_str[-1]}#{stars}#{coins ? 1 : 0}"
ctx.update "#{level_id_str[0]}#{level_id_str[-1]}#{stars}#{coins}"
end
ctx.update "xI25fpAapCQg"