fork download
  1. from ctypes import c_uint32, c_int32
  2.  
  3. unid = "|HItem:2,1236607151:-2029149751:597015773,-1625420703,347303068,847944527:-1:0:130731:19:13:8:369:369:0:0:6:0:380340037:|h[Heaven Hand]|h"
  4.  
  5. def hashString(s):
  6. h = 0
  7. for c in s:
  8. h = c_uint32((h * 0x21) + ord(c)).value
  9. return h
  10.  
  11. def IDLink(s):
  12. parts = s.split(":")
  13.  
  14. # unid link has affixes in reverse order
  15. affixes = parts[3].split(',')
  16. affixes.reverse()
  17. parts[3] = ','.join(affixes)
  18.  
  19. # 0x1 on this flag apparently means ID
  20. parts[9] = str(int(parts[9]) | 0x1)
  21. hash_input = ':'.join(parts[1:-2]) + ':'
  22. link_hash = c_int32(hashString(hash_input)).value
  23. parts[-2] = str(link_hash)
  24.  
  25. id = ':'.join(parts)
  26. return id
  27.  
  28.  
  29. print IDLink(unid)
Success #stdin #stdout 0.01s 7740KB
stdin
https://y...content-available-to-author-only...u.be/UvumbKmKuXM?si=PnWRRPDoetBPiok_3=12 6=15 9=18 2=11 1=10 4=13 7=16 8=17 5=14 // each applying to a different level of control and consciousness on 5 planes of manifestation/adreal symptean grastieal
stdout
|HItem:2,1236607151:-2029149751:847944527,347303068,-1625420703,597015773:-1:0:130731:19:13:9:369:369:0:0:6:0:-1719646810:|h[Heaven Hand]|h