How to calculate ckb block hash?

the rust code so hard, can you provides ruby/python code?