Expand description
Pure Rust InChI and InChIKey generation and parsing for IUPAC standard molecules.
Generates deterministic InChI strings (formula, connectivity, hydrogen, charge, isotope layers) and parses InChI strings back to Molecule representation (simple molecules). Fully WASM-compatible, FFI-free.
§Examples
ⓘ
use chematic_smiles::parse;
use chematic_inchi::{inchi, parse_inchi};
let mol = parse("c1ccccc1").expect("benzene");
let inchi_str = inchi(&mol);
assert_eq!(inchi_str, "InChI=1S/C6H6/c1-2-3-4-5-6-1/h1-6H");
// Parse InChI back to Molecule
let mol2 = parse_inchi(&inchi_str).expect("parse");
assert_eq!(mol2.atom_count(), 6);Re-exports§
pub use parser::parse_inchi;pub use parser::InchiParseError;
Modules§
Functions§
- build_
inchi_ index - Build a mapping from AtomIdx to InChI 1-indexed atom numbers (excluding H).
- inchi
- Generate InChI string for a molecule.
- inchi_
key - Generate InChIKey (27-character alphanumeric identifier) from an InChI string.