implement Hash.toJson() to allow encoding using JsonEncoder from dart:convert