docs.rs failed to build win-base64-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
win-base64-0.1.2
Win-Base64 API
Description
A simple wrapper over the Windows API Base64 Encoding and Decoding
- String to Base64 (
encode) - Base64 to String (
decode)
Sample Code
use decode;
use encode;
let text = "What's up?😊🥘🍲🚩🏁🚀👌😁👍😍❤️💕🎶";
let base64_string = encode?;
let decoded_text = decode?;
// If it worked, text and decoded_text would be the same
println!;
println!;
OUTPUT
Original: What's up?😊👌😁👍😍❤️💕🎶
Decoded: What's up?😊👌😁👍😍❤️💕🎶
Yes this supports Emojis.
Multiple Decodes
-
Decode as
&mut [u8](decode_as_mut8)
Probably the fastest
But the sizes are to be specified manually.
So probably the riskiest as well.let text = "What's up?"; let base64_string = encode?; let mut decoded_arr = vec!; use decode_as_mut8; decode_as_mut8?; // If it worked, text and decoded_text would be the same println!; println!; -
Decode as
Vec<u8>(decode_as_vecu8)
Allocates a vec of the correct size Returns this vec with decoded values Safer than mut u8 as it knows the decoded sizelet text = "What's up?"; let base64_string = encode?; use decode_as_vecu8; let decoded_vec = decode_as_vecu8?; // If it worked, text and decoded_text would be the same println!; println!; -
Decode as String (
decode)
Present in top most exampleuse decode; use encode; let text = "What's up?😊🥘🍲🚩🏁🚀👌😁👍😍❤️💕🎶"; let base64_string = encode?; let decoded_text = decode?; // If it worked, text and decoded_text would be the same println!; println!;