I am wondering what would be the equivalent to nodeJS charCodeAt
in Rust? I have tried digging into the Rust documentation but I have not gotten very far.
However here is where I got so far - it might be not as useful, I do appreciate directions.
Rust
fn main() {
let v1 = "\0\u{1e}2022-Dec-2 11:42:16-0800\0";
println!("{:?}", v1.chars().nth(01));
}
let ReadShort = function (v, p) {
return (v.charCodeAt(p) << 8) + v.charCodeAt(p + 1);
};
let v1 = "\0\u{1e}2022-Dec-2 11:42:16-0800\0";
console.log(ReadShort(v1, 0) == 30); // expected result true