You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
530 B

  1. #[cfg(test)]
  2. mod tests {
  3. use poseidon_rs::Poseidon;
  4. use rustc_hex::ToHex;
  5. #[test]
  6. fn test_output_size() {
  7. let poseidon = Poseidon::new();
  8. let msg = "45";
  9. let h = poseidon.hash_bytes(msg.as_bytes().to_vec()).unwrap();
  10. println!("bigint {:?}", h.to_string());
  11. println!("length {:?}", h.to_bytes_be().1.len());
  12. println!("bytes {:?}", h.to_bytes_be().1);
  13. assert_eq!(h.to_bytes_be().1.len(), 31);
  14. println!("hex {:?}", h.to_bytes_be().1.to_hex());
  15. }
  16. }