This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# cargo-secure | |
# | |
# Sandboxed version of cargo to calm my mind. | |
# Adjust to your liking | |
# | |
set -eu -o pipefail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"encoding/hex" | |
"fmt" | |
"strconv" | |
"strings" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const windows = std.os.windows; | |
/// Do a file operation using the Windows API. | |
/// It can, copy, move, rename, or delete a file or folder. | |
/// Since Windows Vista, it is recommended to use IFileOperation instead. | |
/// | |
/// References: | |
/// - https://docs.rs/windows-sys/0.45.0/windows_sys/Win32/UI/Shell/fn.SHFileOperationA.html | |
/// - https://learn.microsoft.com/en-US/windows/win32/api/shellapi/nf-shellapi-shfileoperationa |