MCPcopy Create free account
hub / github.com/android10/Rust-Cross-Platform-Development / encrypt

Function encrypt

rust-library/cryptor_c/src/lib.rs:6–11  ·  view source on GitHub ↗
(to: *const c_char)

Source from the content-addressed store, hash-verified

4/// Encrypts a String.
5#[no_mangle]
6pub extern "C" fn encrypt(to: *const c_char) -> *mut c_char {
7 let to = unsafe { CStr::from_ptr(to).to_str().unwrap() };
8 let result = cryptor::encrypt(to);
9
10 CString::new(result).unwrap().into_raw()
11}
12
13/// Decrypts a String.
14#[no_mangle]

Calls

no outgoing calls

Tested by 1

test_encrypt_stringFunction · 0.56