From b3c47101aa9636d0f3369935292e8c4c1888c6a8 Mon Sep 17 00:00:00 2001 From: Nanak Nihal Singh Khalsa Date: Sun, 5 Feb 2023 11:52:12 -0500 Subject: [PATCH] js-friendly string method --- src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index bd02f64..65d89ea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -289,6 +289,13 @@ impl Point { lhs.eq(&rhs) } + + pub fn from_xy_strings(x: String, y: String) -> Point { + Point { + x: Fr::from_str(&x).unwrap(), + y: Fr::from_str(&y).unwrap() + } + } } pub fn test_bit(b: &[u8], i: usize) -> bool {