added Rust implementation
compatible with the latest Dart