Bash sha256示例代码
#!/bin/bash

encode() {
    echo -n "$1" | sha256sum | cut -d' ' -f1
}

input="1234567"
encoded=$(encode "$input")
echo "Encoded: $encoded"
SHA256哈希代码示例